Re: FILE = stderr

From: Glynn Clements (glynn@sensei.co.uk)
Date: Wed Jan 05 2000 - 06:27:30 EST


Du Jinsong wrote:

> Hi, I am trying to port a program from BSD to linux. In the code that
> takes care of log messages there is a line:
>
> static FILE *log_output = stderr;
>
> which is okay in BSD, but when try compiling it on linux, I got an
> error:
>
> : initializer element is not constant
>
> so could anyone tell me how to change it to make it work with linux?

Initialise "log_output" with an assignment in the code (before its
value is used by anything, obviously).

"stderr" isn't guaranteed to be a constant, so you can't legally use
it on the RHS of a static initialiser, even if that happens to work on
some architectures.

-- 
Glynn Clements <glynn@sensei.co.uk>

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:12 EST