Path: utzoo!mnetor!uunet!mcvax!tuvie!rcvie From: rcvie@tuvie (ELIN Forsch.z.) Newsgroups: comp.lang.c Subject: Re: 3B2 cpp #ifdef + #include Message-ID: <600@tuvie> Date: 31 Mar 88 12:40:08 GMT References: <109@iquery.UUCP> <3127@csli.STANFORD.EDU> <3210@haddock.ISC.COM> <10171@steinmetz.steinmetz.ge.com> Reply-To: rcvie@tuvie.UUCP (Alcatel-ELIN Forsch.z.) Organization: Technical University of Vienna Lines: 35 Summary: X3J11 is not intended to address VMS problems In article <10171@steinmetz.steinmetz.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: >In article <3210@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes: >> #ifdef foo$bar /* a valid name, in VMS */ > >My notes from the Seattle X3J11 meeting at which identifiers were >defined states that "upper and lower case alphabetics, digits, and the >underscore character" may be used, and that "the first character may not >be a digit." Unless that idea has been changed the $ is not a legal >character for an identifier. I believe that anything goes in a quoted >filename." Dollar signs are valid parts of identifiers in VAXC, as many routines in the run-time library use them (and the routines have to be accessible from VAXC either). Thus these names are normally *hidden* be `#ifdef vms' constructs if portability is needed (as are other system dependent things). Noone would really expect cpp to claim about it. K&R seem to have had this point of view, although not clearly stating: "If the checked condition is true then any lines between #else and #endif are ignored. If the checked condition is false then any lines between the test and an #else or, lacking an #else, the #endif, are ignored. These constructions may be nested." ANSI, however, states explicitely: "Each directive's condition is checked in order. If it evaluates to false (zero), the group that it controls is skipped: directives are processed only through the name that determines the directive to keep track of the level of nested conditionals; the rest of the directives' preprocessing tokens are ignored, as are the other preprocessing tokens in the group. ..." Dietmar Weickert, ALCATEL-ELIN Research Center, Vienna, Austria.