Non-constant initializer problem

Nathan Sidwell nathan@acm.org
Thu Sep 30 19:57:00 GMT 1999


Jxrgen Steensgaard wrote:
> 
> Compiling the following `program'
> 
>    #include <stdio.h>
> 
>    FILE *bug = {stdout};
> 

> It looks as if an earlier accepted construct has been deemed
> unacceptable.

Not necessarily, are you running the same OS version in both cases?
Linux 2.0.x had stdout as a constant expr, this changed in Linux 2.2.x
where it became non-constant (as the standard permits).

> If this is the case, and thus not a bug, what is the rationale?  Use of
> non-constant initializers is described as a gcc extension in the
> info-files.
Only inside a function, not at file scope.

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
        I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk



More information about the Gcc-bugs mailing list