Andrew Pinski wrote:
Wrong, try again. Violating aliasing rules cause undefined behavior
so seg faulting is an okay thing to do.
But producing a warning message and bad code is not OK. Either
using a type-punned pointer should be treated as a fatal
error, because gcc would create bad code, or
Falk Hueffner wrote:
It doesn't know that. The warning is for the *creation* of the
type-punned pointer, which is still perfectly fine. Gcc is too stupid
to notice whether you actually dereference it.
Yup. There are billions of this constructs in everbodies
and his moms source files. By now
Hi folks,
The attached testcase dies on Debian (amd64) if
compiled with -O2.
Here is the usual data:
% gcc -v
Using built-in specs.
Target: x86_64-linux
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr
--libexecdir=/usr/lib
Andrew Pinski wrote:
Stop right there, you said it warns, well this is a case where
you are violating C89/C99/C++ aliasing rules so it is a bug in your
code and not in GCC.
This is not my code. It is XFree86 4.3. I am just trying to
help by investigating a problem and providing an easy