This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re C bug 2035 -


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]