This is the mail archive of the gcc@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: Non-constant initializers


> It seems that code like
> FILE *f = stdin;
> fail because of non-constant initializer.  This did not happen before.

Er, whether this works depends on whether the language or C or C++
(whcih you did not specify) and what the definition of stdin is in
your C libraries (which you also did not specify).

It is supposed to work in C++, and it is undefined whether it works
in C:  It depends on the definition of stdin.  Under traditional
Unix it works, because stdin is &_iob[0]; under many other systems
it doesn't.  This is not a bug in egcs or libc, but a bug in your code.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner


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