CPP bug in sun OS cc?? (or ANSI standard interpretation??)

Vick Khera khera at juliet.cs.duke.edu
Thu Aug 2 22:47:44 AEST 1990


In article <384 at array.UUCP> colin at array.UUCP (Colin Plumb) writes:
 >In article <1579 at idunno.Princeton.EDU> rhl at 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 at cs.duke.edu               Duke University
UUCP:   ..!{mcnc,decvax}!duke!khera     Durham, NC 27706



More information about the Comp.lang.c mailing list