This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14750] type-punned pointer causes bad code
- From: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Mar 2004 19:52:43 -0000
- Subject: [Bug c/14750] type-punned pointer causes bad code
- References: <20040327035806.14750.lindsayd@cisco.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm at polyomino dot org dot uk 2004-03-27 19:52 -------
Subject: Re: type-punned pointer causes bad code
On Sat, 27 Mar 2004, lindsayd at cisco dot com wrote:
> It the compiler is about to generate incorrect code, then it shouldn't be a
> warning, it should be an error.
No, the function might never be executed. DR#109 is clear: "A conforming
implementation must not fail to translate a strictly conforming program
simply because _some_ possible execution of that program would result in
undefined behavior.".
http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_109.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14750