2014-12-20 Martin Uecker <uecker@eecs.berkeley.edu>
commit8a8211dffda1aa4fdb76b75a7c70bc8b5b18c719
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Dec 2014 00:29:16 +0000 (20 00:29 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Dec 2014 00:29:16 +0000 (20 00:29 +0000)
tree0a8c1f437c3f3ba1a17e373c8796d2e79deb28f7
parent4e28babd199a81ced4eb07ef9b65c13c42e0d830
2014-12-20  Martin Uecker <uecker@eecs.berkeley.edu>

* doc/invoke.texi: Document -Wdiscarded-array-qualifiers.
* doc/extend.texi: Document new behavior for pointers to arrays
with qualifiers.

c/
* c-typeck.c: New behavious for pointers to arrays with qualifiers
        (common-pointer-type): For pointers to arrays take qualifiers from
element type.
        (build_conditional_expr): Add warnings for lost qualifiers.
(comp-target-types): Allow pointers to arrays with different qualifiers.
        (convert-for-assignment): Adapt warnings for discarded qualifiers. Add
WARNING_FOR_QUALIFIERS macro and rename WARN_FOR_QUALIFIERS
        to PEDWARN_FOR_QUALIFIERS.

c-family/
* c.opt (Wdiscarded-array-qualifiers): New option.

testsuite/
* gcc.dg/Wwrite-strings-1.c: Change dg-warning.
* gcc.dg/array-quals-1.c: Use -Wno-discarded-array-qualifiers.
* gcc.dg/array-quals-2.c: Change dg-options, dg-warning.
* gcc.dg/pointer-array-atomic.c: New test.
* gcc.dg/pointer-array-quals-1.c: New test.
* gcc.dg/pointer-array-quals-2.c: New test (-pedantic-errors).
* gcc.dg/qual-component-1.c: Change dg-options, dg-warnings.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218985 138bc75d-0d04-0410-961f-82ee72b054a4
15 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wwrite-strings-1.c
gcc/testsuite/gcc.dg/array-quals-1.c
gcc/testsuite/gcc.dg/array-quals-2.c
gcc/testsuite/gcc.dg/pointer-array-atomic.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pointer-array-quals-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pointer-array-quals-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/qual-component-1.c