This is the mail archive of the
mailing list for the Cygwin project.
Re: BUG: stdin not a constant
- To: gnu-win32 at cygnus dot com
- Subject: Re: BUG: stdin not a constant
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Date: Thu, 4 Dec 1997 19:20:37 +1100 (EST)
- Cc: petdr at students dot cs dot mu dot oz dot au
- References: <199712040048.LAA26596@rimmer.cs.mu.OZ.AU>
Peter David ROSS <email@example.com> writes:
>The following code doesn't compile.
>static FILE *out = stdout;
> /* out = stdout; */
> fprintf(out, "hello world\n");
That code is not ANSI/ISO-conformant C.
The ANSI/ISO C standard does not require `stdout' to be a constant
suitable for use in a static initializer.
>The fix is to remove the initialiser and add the line which is commented out.
>However the code I am trying to port has these sort of variables spread
>all over the place,
You have my sympathy ;-)
>and I would like to know if there is someway I can
>get the compiler to treat it as a constant.
I'm fairly sure there's no simple way.
I think you'll just have to fix your non-conformant source code.
Fergus Henderson <firstname.lastname@example.org> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger email@example.com | -- the last words of T. S. Garp.
For help on using this list (especially unsubscribing), send a message to
"firstname.lastname@example.org" with one line of text: "help".