This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Non-constant initializers
- To: Ross Alexander <r dot alexander at auckland dot ac dot nz>
- Subject: Re: Non-constant initializers
- From: Per Bothner <bothner at cygnus dot com>
- Date: Tue, 21 Apr 1998 22:42:07 -0700
- cc: egcs at cygnus dot com
> 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