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 Mon, 1 May 2006, Joseph S. Myers wrote:
> It's for cases such as
>
> unsigned f(unsigned a) { return a + -1; }
>
> with -Wconversion.  OK with such a testcase added to the testsuite.

Many thanks for the speedy review.  I've now committed this change
to mainline as revision 113418 with the following two testcases
(after confirming that this behaviour is indeed unchanged).


2006-05-01  Roger Sayle  <roger@eyesopen.com>
	    Joseph S. Myers  <joseph@codesourcery.com>

	* gcc.dg/Wconversion-3.c: New test case.
	* gcc.dg/Wconversion-4.c: Likewise.

/* { dg-do compile } */
/* { dg-options "-O2 -Wconversion" } */

unsigned f(unsigned a) { return a + -1; }  /* { dg-warning "negative" } */

/* { dg-do compile } */
/* { dg-options "-O2" } */

unsigned f(unsigned a) { return a + -1; }


Roger
--


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