Subject: Re: BUG: stdin not a constant
From: [email-masked] (raf)

7 Dec 1997 15:22:40 -0800
Message-ID: <[email-masked]>
To: [email-masked]

>The following code doesn't compile. 

>------
>#include <stdio.h>

>static FILE *out = stdout;

>void main(void)
>{
>    /* out = stdout; */
>    fprintf(out, "hello world\n");
>}
>------

>It gets the following error message:
>test.c:3: initializer element is not constant

>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, and I would like to know if there is someway I can
>get the compiler to treat it as a constant.

stdout is probably defined as "(&__iob[1])" which is just an expression
because of the parentheses. #undef it a #define it as "&__iob[1]" which
is a constant.

raf

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".