This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Re C bug 2035 -
- To: John Smith <john at arrows dot demon dot co dot uk>
- Subject: Re: Re C bug 2035 -
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Tue, 24 Apr 2001 20:55:46 +0100 (BST)
- cc: <gcc-bugs at gcc dot gnu dot org>
On Tue, 24 Apr 2001, John Smith wrote:
> void mainx(void) {
>
> double v;
>
> struct {
> float f;
> } d;
>
> v = 1.0 ;
> d.f=*(float *)&v;
>
> }
Undefined behavior if ever executed, but the compiler must successfully
translate it since it might never be executed. (Much the same applies to
most cases of code that provably uses an uninitialized variable.)
--
Joseph S. Myers
jsm28@cam.ac.uk