diff options
| author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-17 02:21:10 +0000 |
|---|---|---|
| committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-17 02:21:10 +0000 |
| commit | 261366e3aa109224fc8ba7a768d5070aaaed919b (patch) | |
| tree | 7335d9ce36a52a52d8f29c8470046a48deb92d5c /gcc/c-typeck.c | |
| parent | f006a2e601694bdd419ac4bd046aef733ad1f428 (diff) | |
| download | ppe42-gcc-261366e3aa109224fc8ba7a768d5070aaaed919b.tar.gz ppe42-gcc-261366e3aa109224fc8ba7a768d5070aaaed919b.zip | |
* c-typeck.c (convert_arguments): Don't check for width changes
with -Wtraditional.
* invoke.texi (-Wtraditional): Update documentation.
testsuite:
* gcc.dg/wtr-conversion-1.c: Don't test for width changes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
| -rw-r--r-- | gcc/c-typeck.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 400e80d150c..baf5fed2d07 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -1709,8 +1709,10 @@ convert_arguments (typelist, values, name, fundecl) if (formal_prec == TYPE_PRECISION (float_type_node)) warn_for_assignment ("%s as `float' rather than `double' due to prototype", (char *) 0, name, parmnum + 1); } - /* Detect integer changing in width or signedness. */ - else if (INTEGRAL_TYPE_P (type) + /* Detect integer changing in width or signedness. + These warnings are only activated with + -Wconversion, not with -Wtraditional. */ + else if (warn_conversion && INTEGRAL_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (val))) { tree would_have_been = default_conversion (val); @@ -1755,15 +1757,10 @@ convert_arguments (typelist, values, name, fundecl) else if (TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type) && TREE_UNSIGNED (TREE_TYPE (val))) ; - /* These warnings are only activated with - -Wconversion, not with -Wtraditional. */ - else if (warn_conversion) - { - if (TREE_UNSIGNED (type)) - warn_for_assignment ("%s as unsigned due to prototype", (char *) 0, name, parmnum + 1); - else - warn_for_assignment ("%s as signed due to prototype", (char *) 0, name, parmnum + 1); - } + else if (TREE_UNSIGNED (type)) + warn_for_assignment ("%s as unsigned due to prototype", (char *) 0, name, parmnum + 1); + else + warn_for_assignment ("%s as signed due to prototype", (char *) 0, name, parmnum + 1); } } |

