[Bug c/29901] wrong warning with -Wstrict-aliasing/-fstrict-aliasing
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Nov 19 20:46:00 GMT 2006
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-11-19 20:46 -------
(In reply to comment #0)
> but:
>
> the same address as an object of a different type, unless the
> types are almost the same. For example, an `unsigned int' can
> alias an `int', but not a `void*' or a `double'. A character type
> may alias any other type.
>
> Signed/unsigned casts or casts to char should not produce a warning according
> to the documentation.
Except "unsigned char*" cannot alias "char *". The warning is correct.
What the document is taking about is specificly the non pointers.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29901
More information about the Gcc-bugs
mailing list