Patch committed: Fix -Wc++-compat issues for a number of targets
Joseph S. Myers
joseph@codesourcery.com
Thu Jun 25 13:33:00 GMT 2009
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
joseph@codesourcery.com
More information about the Gcc-patches
mailing list