diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-23 18:39:32 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-23 18:39:32 +0000 |
commit | 583272a21e6049df9034256ab8aefd809663002e (patch) | |
tree | 58e110ee1cede177bc7d803aaddb4783e9aa901a /gcc/testsuite/gcc.dg/overflow-warn-2.c | |
parent | 0732b8097810f81ff404b8e6abb60b1eb37e55f6 (diff) | |
download | gcc-583272a21e6049df9034256ab8aefd809663002e.tar.gz |
2006-11-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/9072
* c.opt (Wtraditional-conversion): New.
(Wconversion): Update description.
* c-typeck.c (convert_arguments): Warnings for prototypes causing
type conversions different from what would happen in the absence
of prototype are now handled by Wtraditional-conversion.
* doc/invoke.texi (Wtraditional-conversion): New.
(Wconversion): Update description.
* doc/trouble.texi (Wconversion): Replace Wconversion by
Wtraditional-conversion.
testsuite/
PR c/9072
* gcc.dg/builtin-protos-1.c: Replace Wconversion by
Wtraditional-conversion.
* gcc.dg/overflow-warn-2.c: Likewise.
* gcc.dg/Wconversion.c: Likewise. Renamed as
Wtraditional-conversion.c .
* gcc.dg/Wconversion-2.c: Likewise. Renamed as
Wtraditional-conversion-2.c .
* gcc.dg/dfp/Wconversion-2.c: Likewise. Renamed as
Wtraditional-conversion-2.c
* gcc.dg/Wconversion-negative-constants.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119129 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/overflow-warn-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/overflow-warn-2.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/gcc/testsuite/gcc.dg/overflow-warn-2.c b/gcc/testsuite/gcc.dg/overflow-warn-2.c index 189f7270363..3fa75b639b3 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-2.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-2.c @@ -1,7 +1,7 @@ -/* Test for diagnostics for constant overflow. Test with -Wconversion. */ +/* Test for diagnostics for constant overflow. Test with -Wtraditional-conversion. */ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do compile } */ -/* { dg-options "-std=c99 -Wconversion" } */ +/* { dg-options "-std=c99 -Wtraditional-conversion" } */ #include <limits.h> @@ -82,23 +82,23 @@ void h2 (void) { fsc (SCHAR_MAX + 1); - /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 84 } */ + /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 84 } */ fsc (SCHAR_MIN - 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 86 } */ + /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 86 } */ fsc (UCHAR_MAX); - /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 88 } */ + /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 88 } */ fsc (UCHAR_MAX + 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wconversion" { target *-*-* } 90 } */ - fuc (-1); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ - /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 92 } */ + /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 90 } */ + fuc (-1); + /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 92 } */ fuc (UCHAR_MAX + 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ - /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 94 } */ - fuc (SCHAR_MIN); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ - /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 96 } */ + /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 94 } */ + fuc (SCHAR_MIN); + /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 96 } */ fuc (SCHAR_MIN - 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ - /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 98 } */ + /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 98 } */ fuc (-UCHAR_MAX); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ - /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wconversion" { target *-*-* } 100 } */ + /* { dg-warning "warning: passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 100 } */ } void fui (unsigned int); @@ -111,7 +111,7 @@ void h2i (int x) { /* For some reason, we only give certain warnings for implicit - conversions among values of the same precision with -Wconversion, + conversions among values of the same precision with -Wtraditional-conversion, while we don't give others at all. */ fsi ((unsigned)INT_MAX + 1); /* { dg-warning "warning: passing argument 1 of 'fsi' as signed due to prototype" } */ si = (unsigned)INT_MAX + 1; @@ -121,12 +121,12 @@ h2i (int x) si = x ? (unsigned)INT_MAX + 2 : 1; fsi (UINT_MAX); /* { dg-warning "warning: passing argument 1 of 'fsi' as signed due to prototype" } */ si = UINT_MAX; - fui (-1); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ - /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wconversion" { target *-*-* } 124 } */ - ui = -1; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ - ui = x ? -1 : 1U; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ - fui (INT_MIN); /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ - /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wconversion" { target *-*-* } 128 } */ - ui = INT_MIN; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ - ui = x ? INT_MIN : 1U; /* { dg-warning "warning: negative integer implicitly converted to unsigned type" } */ + fui (-1); + /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wtraditional-conversion" { target *-*-* } 124 } */ + ui = -1; + ui = x ? -1 : 1U; + fui (INT_MIN); + /* { dg-warning "warning: passing argument 1 of 'fui' as unsigned due to prototype" "-Wtraditional-conversion" { target *-*-* } 128 } */ + ui = INT_MIN; + ui = x ? INT_MIN : 1U; } |