This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Make unsigned_conversion_warning static
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 1 May 2006 11:41:01 +0000 (UTC)
- Subject: Re: [C PATCH] Make unsigned_conversion_warning static
- References: <Pine.LNX.4.44.0604302131020.27687-100000@www.eyesopen.com>
On Sun, 30 Apr 2006, Roger Sayle wrote:
> The single external use is in parser_build_binary_op, where in 1993
> RMS added two calls to check that the operands of a binary function
> didn't overflow when converted to the result_type of a binary operator.
> I'm not sure this could ever happen with C's promotion/common_type
> rules. However, a better way to achieve this same checking is to
It's for cases such as
unsigned f(unsigned a) { return a + -1; }
with -Wconversion. OK with such a testcase added to the testsuite.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)