[cfe-dev] Warnings when building with gcc-4.5

Douglas Gregor dgregor at apple.com
Mon May 10 11:27:44 PDT 2010


On May 6, 2010, at 8:04 AM, Mulder, Jonathan wrote:

> Hello all,
> 
> I have been compiling clang using the stock gcc on apple (4.2.1) for awhile with no issues or warnings, but now I am trying to compile clang using the gcc 4.5.0 release, and I am getting a bunch of warnings of this variety.
> 
> llvm[4]: Compiling ParseExprCXX.cpp for Debug build
> ParseExprCXX.cpp: In member function ‘clang::Parser::OwningExprResult clang::Parser::ParseCXXAmbiguousParenExpression(clang::Parser::ParenParseOption&, clang::Parser::TypeTy*&, clang::SourceLocation, clang::SourceLocation&)’:
> ParseExprCXX.cpp:1774:54: warning: converting ‘false’ to pointer type for argument 4 of ‘clang::Parser::OwningExprResult clang::Parser::ParseCastExpression(bool, bool, bool&, clang::Parser::TypeTy*)’
> 
> llvm[2]: Compiling ExecutionEngineTest.cpp for Debug build
> ExecutionEngineTest.cpp: In member function ‘virtual void<unnamed>::ExecutionEngineTest_ForwardGlobalMapping_Test::TestBody()’:
> ExecutionEngineTest.cpp:52:3: warning: passing NULL to non-pointer argument 3 of ‘static testing::AssertionResult testing::internal::EqHelper<true>::Compare(const char*, const char*, const T1&, T2*) [with T1 = int, T2 = void]’
> 
> Where they are either booleans (generally false values) being converted to pointer types, or the latter of passing NULL to non-pointer types.  If you could enlighten me as to the proper way to silence these warning I would be happy to go through them all and submit a patch.

These look like potential bugs in LLVM and Clang, each of which will have to be considered. If you're willing to fix these cases and provide a patch, that would be wonderful.

(Clang should probably warn about these kinds of conversions, too!)

	- Doug



More information about the cfe-dev mailing list