This is the mail archive of the gcc-patches@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: [C PATCH] Make unsigned_conversion_warning static


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)


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