This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29901] wrong warning with -Wstrict-aliasing/-fstrict-aliasing
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2006 20:46:35 -0000
- Subject: [Bug c/29901] wrong warning with -Wstrict-aliasing/-fstrict-aliasing
- References: <bug-29901-3916@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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