flex

Larry Jones scjones at sdrc.UUCP
Thu May 12 10:03:46 AEST 1988


In article <690 at naucse.UUCP>, jdc at naucse.UUCP (John Campbell) writes:
> The 'C' question:
>   Flex has the following global line:
> 
>      FILE *yyin=stdin, *yyout=stdout;
> 
>   which does not work at compile time on VMS.  In other words, it appears
>   the compiler does not treat stdin as a constant--it's value is known only
>   at run-time.  (VMS stdio.h says "extern noshare FILE *stdin;.) To work 

According to the latest ANSI draft (and many of the previous ones), stdin and
friends are simply expressions and not necessarily constant expressions.  Thus,
they may not be used portably to initialize objects with static storage
duration.  So, the compiler's OK, flex is not maximally portable (as you
found out).

----
Larry Jones                         UUCP: ...!sdrc!scjones
SDRC                                AT&T: (513) 576-2070
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150
"When all else fails, read the directions."



More information about the Comp.lang.c mailing list