r245304 - We shouldn't need to pass -fno-strict-aliasing when building clang with clang.

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 18 11:38:26 PDT 2015


On Tue, Aug 18, 2015 at 11:26 AM, Chris Bieneman via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

>
> I don’t have access to gcc to test removing the flag there. I see no
> reason not to remove it for gcc, but I haven’t and can’t test it. Someone
> else will need to test it before committing.
>

I tested it. There's tons of warnings.

It actually fires on this construct, where we go out of our way to cast via
an omnipotent char*:
APValue.h:309:45: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
  return ((const AddrLabelDiffData*)(const char*)Data.buffer)->LHSExpr;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150818/20e4dd87/attachment.html>


More information about the cfe-commits mailing list