[Bug c/95630] rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Nov 23 23:29:41 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95630
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joseph Myers <jsm28@gcc.gnu.org>:
https://gcc.gnu.org/g:ed431431e069b59a1cfdd877134873248d8c93a6
commit r11-5265-ged431431e069b59a1cfdd877134873248d8c93a6
Author: Joseph Myers <joseph@codesourcery.com>
Date: Mon Nov 23 23:28:58 2020 +0000
c: Allow comparison of pointers to complete and incomplete types for C11
[PR95630]
As noted in bug 95630, C11 removed a restriction in C99 on comparing
pointers to compatible complete and incomplete types (this was one of
the changes in N1439, which was largely a terminological change to
make incomplete types a subset of object types rather than a different
kind of type). Implement that change by using pedwarn_c99 with
OPT_Wpedantic for this diagnostic.
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc/c/
2020-11-23 Joseph Myers <joseph@codesourcery.com>
PR c/95630
* c-typeck.c (build_binary_op): Use pedwarn_c99 with OPT_Wpedantic
for comparisons of complete and incomplete pointers.
gcc/testsuite/
2020-11-23 Joseph Myers <joseph@codesourcery.com>
PR c/95630
* gcc.dg/c11-compare-incomplete-1.c,
gcc.dg/c11-compare-incomplete-2.c,
gcc.dg/c99-compare-incomplete-1.c,
gcc.dg/c99-compare-incomplete-2.c: New tests.
More information about the Gcc-bugs
mailing list