aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-07-06 06:32:24 +0000
committerRichard Stallman <rms@gnu.org>1993-07-06 06:32:24 +0000
commitce9895ae049805bdb4f2ef771f9fa41487641dfd (patch)
tree94f924bc9f4fd45225339ec6989b22a019459862
parentec820a12da7933bc7aa900ff4d5ace82ba821d13 (diff)
downloadgcc-ce9895ae049805bdb4f2ef771f9fa41487641dfd.zip
gcc-ce9895ae049805bdb4f2ef771f9fa41487641dfd.tar.gz
gcc-ce9895ae049805bdb4f2ef771f9fa41487641dfd.tar.bz2
(convert_arguments): Don't warn for -Wconversion about signedness of an arg...
(convert_arguments): Don't warn for -Wconversion about signedness of an arg that's extended from narrower unsigned type. From-SVN: r4857
-rw-r--r--gcc/c-typeck.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 00de4cb..33b20c65 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2079,6 +2079,13 @@ convert_arguments (typelist, values, name, fundecl)
/* Change in signedness doesn't matter
if an enum value is unaffected. */
;
+ /* If the value is extended from a narrower
+ unsigned type, it doesn't matter whether we
+ pass it as signed or unsigned; the value
+ certainly is the same either way. */
+ else if (TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type)
+ && TREE_UNSIGNED (TREE_TYPE (val)))
+ ;
else if (TREE_UNSIGNED (type))
warn_for_assignment ("%s as unsigned due to prototype", (char *) 0, name, parmnum + 1);
else