Skip to content

Fix gcc-9.3 compile errors (-Werror=format-security) #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ggreif
Copy link
Contributor

@ggreif ggreif commented May 14, 2020

Fixes a bunch of error when compiling with gcc-9.3, like below:

/home/ggreif/llvm-project/lldb/source/Core/Module.cpp: In member function ‘void lldb_private::Module::FindTypes_Impl(lldb_private::ConstString, const lldb_private::CompilerDeclContext&, size_t, llvm::DenseSet<lldb_private::SymbolFile*>&, lldb_private::TypeMap&)’:
/home/ggreif/llvm-project/lldb/source/Core/Module.cpp:930:52: error: format not a string literal and no format arguments [-Werror=format-security]
  930 |   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
      |                                                    ^
/home/ggreif/llvm-project/lldb/source/Core/Module.cpp: In member function ‘void lldb_private::Module::FindTypes(llvm::ArrayRef<lldb_private::CompilerContext>, lldb_private::LanguageSet, llvm::DenseSet<lldb_private::SymbolFile*>&, lldb_private::TypeMap&)’:
/home/ggreif/llvm-project/lldb/source/Core/Module.cpp:1018:52: error: format not a string literal and no format arguments [-Werror=format-security]
 1018 |   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
      |                                                    ^
/home/ggreif/llvm-project/lldb/source/Core/Module.cpp: In member function ‘virtual lldb_private::SymbolFile* lldb_private::Module::GetSymbolFile(bool, lldb_private::Stream*)’:
/home/ggreif/llvm-project/lldb/source/Core/Module.cpp:1030:58: error: format not a string literal and no format arguments [-Werror=format-security]
 1030 |         Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
      |                                                          ^

These are unsafe uses of format strings, worth fixing.

@repo-lockdown
Copy link

repo-lockdown bot commented May 14, 2020

This repository does not accept pull requests. Please follow http://llvm.org/docs/Contributing.html#how-to-submit-a-patch for contribution to LLVM.

@repo-lockdown repo-lockdown bot closed this May 14, 2020
@repo-lockdown repo-lockdown bot locked and limited conversation to collaborators May 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant