PR c/80731 - poor -Woverflow warnings
authorMartin Sebor <msebor@redhat.com>
Wed, 24 May 2017 22:07:21 +0000 (22:07 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 24 May 2017 22:07:21 +0000 (16:07 -0600)
commit3cd211af9989ca33f08c9d9d7c29ba7cb208b645
tree65c34bbc585e40c4958be3f1fc9ddbc5624dd312
parent1ab4db9379e5096a04c4c68b9edfef9c938cf3b5
PR c/80731 - poor -Woverflow warnings

gcc/c-family/ChangeLog:

PR c/80731
* c-common.h (unsafe_conversion_p): Add a function argument.
* c-common.c (unsafe_conversion_p): Same.
Add type names and values to diagnostics.
(scalar_to_vector): Adjust.
* c-warn.c (constant_expression_error): Add a function argument.
Add type names and values to diagnostics.
(conversion_warning): Add a function argument.
Add type names and values to diagnostics.
(warnings_for_convert_and_check): Same.

gcc/c/ChangeLog:

PR c/80731
* c-fold.c (c_fully_fold_internal): Adjust.
* c-typeck.c (parser_build_unary_op): Adjust.

gcc/cp/ChangeLog:

PR c/80731
* call.c (fully_fold_internal): Adjust.

gcc/testsuite/ChangeLog:

PR c/80731
* c-c++-common/Wfloat-conversion.c: Adjust.
* c-c++-common/dfp/convert-int-saturate.c: Same.
* c-c++-common/pr68657-1.c: Same.
* g++.dg/ext/utf-cvt.C: Same.
* g++.dg/ext/utf16-4.C: Same.
* g++.dg/warn/Wconversion-real-integer-3.C: Same.
* g++.dg/warn/Wconversion-real-integer2.C: Same.
* g++.dg/warn/Wconversion3.C: Same.
* g++.dg/warn/Wconversion4.C: Same.
* g++.dg/warn/Wsign-conversion.C: Same.
* g++.dg/warn/overflow-warn-1.C: Same.
* g++.dg/warn/overflow-warn-3.C: Same.
* g++.dg/warn/overflow-warn-4.C: Same.
* g++.dg/warn/pr35635.C: Same.
* g++.old-deja/g++.mike/enum1.C: Same.
* gcc.dg/Wconversion-3.c: Same.
* gcc.dg/Wconversion-5.c: Same.
* gcc.dg/Wconversion-complex-c99.c: Same.
* gcc.dg/Wconversion-complex-gnu.c: Same.
* gcc.dg/Wconversion-integer.c: Same.
* gcc.dg/Wsign-conversion.c: Same.
* gcc.dg/bitfld-2.c: Same.
* gcc.dg/c90-const-expr-11.c: Same.
* gcc.dg/c90-const-expr-7.c: Same.
* gcc.dg/c99-const-expr-7.c: Same.
* gcc.dg/overflow-warn-1.c: Same.
* gcc.dg/overflow-warn-2.c: Same.
* gcc.dg/overflow-warn-3.c: Same.
* gcc.dg/overflow-warn-4.c: Same.
* gcc.dg/overflow-warn-5.c: Same.
* gcc.dg/overflow-warn-8.c: Same.
* gcc.dg/overflow-warn-9.c: New test.
* gcc.dg/pr35635.c: Adjust.
* gcc.dg/pr59940.c: Same.
* gcc.dg/pr59963-2.c: Same.
* gcc.dg/pr60114.c: Same.
* gcc.dg/switch-warn-2.c: Same.
* gcc.dg/utf-cvt.c: Same.
* gcc.dg/utf16-4.c: Same.

From-SVN: r248431
49 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c-warn.c
gcc/c/ChangeLog
gcc/c/c-fold.c
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wfloat-conversion.c
gcc/testsuite/c-c++-common/dfp/convert-int-saturate.c
gcc/testsuite/c-c++-common/pr68657-1.c
gcc/testsuite/g++.dg/ext/utf-cvt.C
gcc/testsuite/g++.dg/ext/utf16-4.C
gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C
gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C
gcc/testsuite/g++.dg/warn/Wconversion3.C
gcc/testsuite/g++.dg/warn/Wconversion4.C
gcc/testsuite/g++.dg/warn/Wsign-conversion.C
gcc/testsuite/g++.dg/warn/overflow-warn-1.C
gcc/testsuite/g++.dg/warn/overflow-warn-3.C
gcc/testsuite/g++.dg/warn/overflow-warn-4.C
gcc/testsuite/g++.dg/warn/pr35635.C
gcc/testsuite/g++.old-deja/g++.mike/enum1.C
gcc/testsuite/gcc.dg/Wconversion-3.c
gcc/testsuite/gcc.dg/Wconversion-5.c
gcc/testsuite/gcc.dg/Wconversion-complex-c99.c
gcc/testsuite/gcc.dg/Wconversion-complex-gnu.c
gcc/testsuite/gcc.dg/Wconversion-integer.c
gcc/testsuite/gcc.dg/Wsign-conversion.c
gcc/testsuite/gcc.dg/bitfld-2.c
gcc/testsuite/gcc.dg/c90-const-expr-11.c
gcc/testsuite/gcc.dg/c90-const-expr-7.c
gcc/testsuite/gcc.dg/c99-const-expr-7.c
gcc/testsuite/gcc.dg/overflow-warn-1.c
gcc/testsuite/gcc.dg/overflow-warn-2.c
gcc/testsuite/gcc.dg/overflow-warn-3.c
gcc/testsuite/gcc.dg/overflow-warn-4.c
gcc/testsuite/gcc.dg/overflow-warn-5.c
gcc/testsuite/gcc.dg/overflow-warn-8.c
gcc/testsuite/gcc.dg/overflow-warn-9.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr35635.c
gcc/testsuite/gcc.dg/pr59940.c
gcc/testsuite/gcc.dg/pr59963-2.c
gcc/testsuite/gcc.dg/pr60114.c
gcc/testsuite/gcc.dg/switch-warn-2.c
gcc/testsuite/gcc.dg/utf-cvt.c
gcc/testsuite/gcc.dg/utf16-4.c