This is the mail archive of the 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: Patch committed: Fix -Wc++-compat issues for a number of targets

On Wed, 24 Jun 2009, Ian Lance Taylor wrote:

> The biggest change was certainly for avr, where it is no longer possible
> to use the AS2 macro with operator names like "and" and "or".  I'm not
> sure why the code uses the AS2 macro anyhow, as it seems to make the
> code less readable for no obvious benefit.  I replaced the cases using
> "and" and "or" with simple strings.

Although this change makes the code clearer, the fact that it was needed 
indicates a defect in -Wc++-compat.  Unless preprocessing tokens such as 
"and" and "or" are converted to tokens, either tokens passed to the 
compiler or tokens in #if expressions, or are used as macro names or macro 
parameter names, no C++ compatibility issues arise.  In particular, this 
code that stringizes those preprocessing tokens has no actual C++ 
compatibility issues, nor does code using them in the definitions of 
macros that are never expanded.

Joseph S. Myers

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