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: question regarding new warning


> From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On Behalf Of
> Andrew Haley
> 
> Assigning a negative literal to an unsigned variable is well-defined
> standard C.  Is it really appropriate to warn for correct code?

There is lots of cases where gcc warn construct in correct code. Think for
instance at unused variables. I think this is the same kind of situation here:
the construct is valid but for many (or at least some) users it's not something
they are likely to use and might indicate an error. I think the rationale provided
by Daniel is sound.

Thomas Preud'homme



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