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: 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


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