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
On May 8, 2005, at 2:21 AM, Harald Dunkel wrote:
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
Harald Dunkel [EMAIL PROTECTED] writes:
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
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
On May 8, 2005, at 4:17 PM, Harald Dunkel wrote:
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
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
On May 7, 2005, at 2:04 PM, Harald Dunkel wrote:
Hi folks,
The testcase has been created by grabbing some code
fragments from libX11, XFree86 4.3 on Debian, amd64.
-Wall complains about dereferencing type-punned pointer.
Stop right there, you said it warns, well this is a case where
you are
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
On May 7, 2005, at 3:25 PM, Harald Dunkel wrote:
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