This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: initializer element is not constant
- To: hjl@lucon.org
- Subject: Re: initializer element is not constant
- From: Geoffrey KEATING <geoffk@discus.anu.edu.au>
- Date: Sun, 28 Jun 1998 14:42:10 +1000 (EST)
- CC: keys@brio.yikes.com, libc-alpha@cygnus.com
- References: <m0ypjnX-000265C@ocean.lucon.org>
> 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>