This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Add new CPP arithmetic warning?
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Zack Weinberg <zack at codesourcery dot com>, <gcc at gcc dot gnu dot org>
- Date: Fri, 19 Jul 2002 11:25:39 +0100 (BST)
- Subject: Re: Add new CPP arithmetic warning?
On Fri, 19 Jul 2002, Neil Booth wrote:
> Here's an interesting question. Do we want to warn in this case
> (EDG does, my initial patch doesn't).
>
> #if 1 ? 0U : -1
> #endif
For consistency with the compiler, this should be warned about iff
-Wsign-compare. For the more general warning issues (about implicit
conversions, of sign or otherwise, that may change values), see the
discussion of better -Wconversion in the projects list.
--
Joseph S. Myers
jsm28@cam.ac.uk