Subject: Re: quick question to C programmers
To: Georg Schwarz <georg.schwarz@freenet.de>
From: Hauke Fath <hf@spg.tu-darmstadt.de>
List: tech-pkg
Date: 04/07/2005 15:50:20
Am 07.04.2005 um 15:32 Uhr +0200 schrieb Georg Schwarz:
>I am trying to compile x11/Xaw-Xpm using gcc 2.95. It fails like this:
>
>laylex.c:45: initializer element is not constant
>laylex.c:45: (near initialization for `LayYYin')
>laylex.c:45: initializer element is not constant
>laylex.c:45: (near initialization for `LayYYout')
>
>The respective line looks like this:
>
>FILE *LayYYin = {stdin}, *LayYYout = {stdout};
>
>What are the brackets for?
FILE is a struct, see <stdio.h>.
>Does anyone know why it fails? The two variables seem to be defined
>globally in that line. Why aren't stdin and stdout considered constants?
Well, what are they?
Try compiling with -E and look at the preprocessor output to find out
what the compiler gets to see.
hauke
--
/~\ The ASCII Ribbon Campaign Hauke Fath
\ / No HTML/RTF in email Institut für Nachrichtentechnik
X No Word docs in email TU Darmstadt
/ \ Respect for open standards Ruf +49-6151-16-3281