This is the mail archive of the
mailing list for the GCC project.
Re: Patch committed: Fix -Wc++-compat issues for a number of targets
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 25 Jun 2009 11:44:57 +0000 (UTC)
- Subject: Re: Patch committed: Fix -Wc++-compat issues for a number of targets
- References: <firstname.lastname@example.org>
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