Xref: utzoo comp.sources.d:2097 comp.os.vms:6027 comp.lang.c:10104 Path: utzoo!attcan!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.sources.d,comp.os.vms,comp.lang.c Subject: Re: flex Summary: FILE *stuff=stdin; not valid Keywords: flex on VMS Message-ID: <278@sdrc.UUCP> Date: 12 May 88 00:03:46 GMT References: <690@naucse.UUCP> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 22 In article <690@naucse.UUCP>, jdc@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."