<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 7, 2010, at 7:58 PM, Mulder, Jonathan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I know this was a long time back (I kinda forgot about this, sorry), but I was wondering if this was the proper way to silence these warnings. Basically, I did it for APValue as a first go, and if it works I will keep on pruning out the errors. All I did was put a (void *) cast in between the other errors to silence the gcc warnings.<div>
<br></div><div>Let me know what you think...</div></blockquote><div><br></div><div>We went ahead and added -fno-strict-aliasing, since we've run into too many false positives with these particular warnings and we don't want to uglify the code with so many (void*) casts.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div><br><blockquote type="cite"><div>Jon</div><div><br><div class="gmail_quote">On Mon, May 10, 2010 at 1:27 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5"><br>
On May 6, 2010, at 8:04 AM, Mulder, Jonathan wrote:<br>
<br>
> Hello all,<br>
><br>
> 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.<br>
><br>
> llvm[4]: Compiling ParseExprCXX.cpp for Debug build<br>
> ParseExprCXX.cpp: In member function ‘clang::Parser::OwningExprResult clang::Parser::ParseCXXAmbiguousParenExpression(clang::Parser::ParenParseOption&, clang::Parser::TypeTy*&, clang::SourceLocation, clang::SourceLocation&)’:<br>
> 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*)’<br>
><br>
> llvm[2]: Compiling ExecutionEngineTest.cpp for Debug build<br>
> ExecutionEngineTest.cpp: In member function ‘virtual void<unnamed>::ExecutionEngineTest_ForwardGlobalMapping_Test::TestBody()’:<br>
> 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]’<br>
><br>
> 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.<br>
<br>
</div></div>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.<br>
<br>
(Clang should probably warn about these kinds of conversions, too!)<br>
<br>
- Doug</blockquote></div><br></div>
<span><APValueStrictAliasing.patch></span></blockquote></div><br></body></html>