This is the mail archive of the
mailing list for the GCC project.
RE: question regarding new warning
- From: "Thomas Preud'homme" <thomas dot preudhomme at arm dot com>
- To: "Daniel Gutson" <daniel dot gutson at tallertechnologies dot com>, <gcc at gcc dot gnu dot org>
- Date: Thu, 27 Mar 2014 16:05:06 +0800
- Subject: RE: question regarding new warning
- Authentication-results: sourceware.org; auth=none
- References: <CAF5HaEV2vt=epA4h-rPGDNnXtUFWXhJeqyAF0k06b1Wuoec97g at mail dot gmail dot com> <5333D6F5 dot 5080008 at redhat dot com>
> From: firstname.lastname@example.org [mailto:email@example.com] 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.