a warning to implement

Joe Buck jbuck@synopsys.COM
Wed Feb 6 12:22:00 GMT 2002


Robert writes:
> But Gaby, right now, the construct
> 
>  int a = a;
> 
> produces an undefined result, so no one can use it. It might suppress
> warnings in one version of gcc, but then someone might submit a patch
> that causes it to have some disastrous effect, and no one would have
> a right to complain, since if they are using this, they are using an
> undocumented behavior, and have no right to count on it.

One possible disasterous effect is that
	float a = a;
with debugging off might generate an actual load and store, and if it
reads stack noise that looks like a signalling NaN, boom.  The compiler
could avoid this by optimizing away the assignment even at -O0.



More information about the Gcc mailing list