This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: initializer element is not constant


> From: hjl@lucon.org (H.J. Lu)
> Date: Fri, 26 Jun 1998 18:28:59 -0700 (PDT)

[Matt said:]
> > FILE *infp = stdin;
> > 
> > and the gcc error is:
> > 
> > mknodes.c:92: initializer element is not constant
> > 
> > to fix it, ive just changed all the infp usages to stdin. but what's the
> > real fix?

> main ()
> {
>   infp = stdin;
> }

Or for those cases when this is inconvenient,

FILE *infp;
static void infp_construct (void) __attribute__((constructor));
static void infp_construct (void) { infp = stdin; }

-- 
Geoff Keating <Geoff.Keating@anu.edu.au>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]