Path: utzoo!attcan!uunet!wuarchive!usc!rutgers!mephisto!mcnc!duke!juliet!khera From: khera@juliet.cs.duke.edu (Vick Khera) Newsgroups: comp.lang.c Subject: Re: CPP bug in sun OS cc?? (or ANSI standard interpretation??) Message-ID: <21169@duke.cs.duke.edu> Date: 2 Aug 90 12:47:44 GMT References: <1579@idunno.Princeton.EDU> <384@array.UUCP> Sender: news@duke.cs.duke.edu Reply-To: khera@cs.duke.edu (Vick Khera) Organization: Duke University CS Dept., Durham, NC 27706 Lines: 30 In article <384@array.UUCP> colin@array.UUCP (Colin Plumb) writes: >In article <1579@idunno.Princeton.EDU> rhl@grendel.Princeton.EDU (Robert Lupton (the Good)) writes: >> The following fails to compile on a sparc running Sun O/S 4.0.3: >> #define line LINE >> main() >> { >> #line 1234 "junk.c" >> } >> as the "#line" is treated as "#LINE" -- does ansi allow this?? > >Section 3.8.3 Macro Replacement >Semantics, paragraph 2: > > If a # preprocessing token, followed by an identifier, occurs lexically at >the point at which a preprocessing directive could begin, the identifier is >not subject to macro replacement. > >This is from the December 7, 1988 draft. Looks like it's illegal. > -Colin since when did sun claim their sparc compiler under 4.0.3 was ANSI compliant? how can it be illegal if it never intended to follow the new rules? v. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vick Khera (919) 660-6528 Department of Computer Science ARPA: khera@cs.duke.edu Duke University UUCP: ..!{mcnc,decvax}!duke!khera Durham, NC 27706