CPP bug in sun OS cc?? (or ANSI standard interpretation??)
Colin Plumb
colin at array.UUCP
Thu Aug 2 14:19:31 AEST 1990
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
More information about the Comp.lang.c
mailing list