re PR c/81233 (--Wdiscarded-qualifiers and Wincompatible-pointer-types missing import...
authorMarek Polacek <polacek@redhat.com>
Wed, 9 Aug 2017 11:28:22 +0000 (11:28 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 9 Aug 2017 11:28:22 +0000 (11:28 +0000)
commit296c53ac8ad2a1ec7483d81f8ed9e2eee520f841
tree55125f47ef7ad3c4c9971722231b7e845ddabe49
parenta32c8316ff282ec3eb60e222e91fb19998c12f46
re PR c/81233 (--Wdiscarded-qualifiers and Wincompatible-pointer-types missing important detail)

PR c/81233
* c-typeck.c (pedwarn_init): Make the function take a variable list.
Call emit_diagnostic_valist instead of pedwarn.
(convert_for_assignment): Unroll the PEDWARN_FOR_ASSIGNMENT macro.
Print the relevant types in diagnostics.

* diagnostic-core.h (emit_diagnostic_valist): Add declaration.
* diagnostic.c (emit_diagnostic): Add a comment.
(emit_diagnostic_valist): New function.

* gcc.dg/diagnostic-types-1.c: New test.
* gcc.dg/assign-warn-1.c: Update warning messages.
* gcc.dg/assign-warn-2.c: Likewise.
* gcc.dg/c90-const-expr-5.c: Likewise.
* gcc.dg/c99-const-expr-5.c: Likewise.
* gcc.dg/conv-2.c: Likewise.
* gcc.dg/init-bad-7.c: Likewise.
* gcc.dg/overflow-warn-1.c: Likewise.
* gcc.dg/overflow-warn-2.c: Likewise.
* gcc.dg/overflow-warn-3.c: Likewise.
* gcc.dg/overflow-warn-4.c: Likewise.
* gcc.dg/pointer-array-atomic.c: Likewise.
* gcc.dg/pr26865.c: Likewise.
* gcc.dg/pr61162-2.c: Likewise.
* gcc.dg/pr61162.c: Likewise.
* gcc.dg/pr67730-2.c: Likewise.
* gcc.dg/pr69156.c: Likewise.
* gcc.dg/pr70174.c: Likewise.
* objc.dg/proto-lossage-4.m: Likewise.

From-SVN: r250985
25 files changed:
gcc/ChangeLog
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/diagnostic-core.h
gcc/diagnostic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/assign-warn-1.c
gcc/testsuite/gcc.dg/assign-warn-2.c
gcc/testsuite/gcc.dg/c90-const-expr-5.c
gcc/testsuite/gcc.dg/c99-const-expr-5.c
gcc/testsuite/gcc.dg/conv-2.c
gcc/testsuite/gcc.dg/diagnostic-types-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/init-bad-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/pointer-array-atomic.c
gcc/testsuite/gcc.dg/pr26865.c
gcc/testsuite/gcc.dg/pr61162-2.c
gcc/testsuite/gcc.dg/pr61162.c
gcc/testsuite/gcc.dg/pr67730-2.c
gcc/testsuite/gcc.dg/pr69156.c
gcc/testsuite/gcc.dg/pr70174.c
gcc/testsuite/objc.dg/proto-lossage-4.m