ashのコンパイルが出来ない。

同じ悩みの人がいた。

since glibc 2.1, file pointers to things like stdin, stdout, stderr, etc.
don't seem to work anymore (in some situations).

for example, in ash (mknodes.c:92) there is the line:

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?


解決編1

FILE *infp;

main ()
{
  infp = stdin;
}


解決編2

Or for those cases when this is inconvenient,

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