This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: error: "no newline at end of file"


On 4/1/07, Robert Dewar <dewar@adacore.com> wrote:
Zack Weinberg wrote:
It's not bending the language, the standard has nothing whatever to say
about -D. I see no reason not to be completely permissive wrt -D if it
is going to make transition smoother.

The thing is, the standard does not read "An identifier which has previously been defined by a #define directive shall not be redefined by another #define directive except as the same type of macro and with the same replacement-list". If it did, I would agree with you. Instead, it reads "An identifier CURRENTLY DEFINED ... shall not be redefined by a #define directive" (emphasis mine). The intent is, IMO, clearly to forbid (non-redundant) redefinition no matter how the identifier acquired a macro definition in the first place - whether by another #define, or by being built-in macros, or by -D.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]