Xref: utzoo comp.unix.questions:6312 comp.unix.wizards:7444 comp.lang.c:8652 Path: utzoo!utgpu!water!watmath!clyde!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.lang.c Subject: Re: 3B2 cpp #ifdef + #include Message-ID: <3210@haddock.ISC.COM> Date: 29 Mar 88 17:22:52 GMT References: <109@iquery.UUCP> <3127@csli.STANFORD.EDU> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Followup-To: comp.lang.c Organization: Interactive Systems, Boston Lines: 22 In article <3127@csli.STANFORD.EDU> gandalf@csli.stanford.edu (Juergen Wagner) writes: >The problem with your cpp is that all the lines starting with # have to >be valid syntax, i.e. "junk junk" is not relevant because it is just text >and cpp doesn't know if this is correct or not, but "# include junk" is >invalid because is violates cpp syntax. "#include junk" is legal (in ANSI C, anyway) if "junk" is a macro that expands into a quoted or embroketed header name. Thus, #ifdef junk #include junk #endif should be legal. This is indeed a bug in certain preprocessors. Similarly, I believe that the warning produced by #ifdef vms #ifdef foo$bar /* a valid name, in VMS */ #endif #endif on non-VMS systems is inappropriate, though I haven't yet determined what the latest dpANS says about this. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint Followups to comp.lang.c only.