public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95630] New: rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode
@ 2020-06-10 22:09 richard-gccbugzilla at metafoo dot co.uk
2020-11-23 23:29 ` [Bug c/95630] " cvs-commit at gcc dot gnu.org
2020-11-23 23:32 ` jsm28 at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2020-06-10 22:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95630
Bug ID: 95630
Summary: rejects-valid on comparison of pointers to complete vs
incomplete types in C11 mode
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
int f(int (*p)[], int (*q)[3]) { return p < q; }
This is a constraint violation in C99, but the relevant rule was removed in
C11. GCC still rejects in -std=c11 mode under -pedantic-errors.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/95630] rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode
2020-06-10 22:09 [Bug c/95630] New: rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode richard-gccbugzilla at metafoo dot co.uk
@ 2020-11-23 23:29 ` cvs-commit at gcc dot gnu.org
2020-11-23 23:32 ` jsm28 at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-23 23:29 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/95630] rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode
2020-06-10 22:09 [Bug c/95630] New: rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode richard-gccbugzilla at metafoo dot co.uk
2020-11-23 23:29 ` [Bug c/95630] " cvs-commit at gcc dot gnu.org
@ 2020-11-23 23:32 ` jsm28 at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2020-11-23 23:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95630
Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |11.0
--- Comment #2 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
Fixed for GCC 11.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-23 23:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 22:09 [Bug c/95630] New: rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode richard-gccbugzilla at metafoo dot co.uk
2020-11-23 23:29 ` [Bug c/95630] " cvs-commit at gcc dot gnu.org
2020-11-23 23:32 ` jsm28 at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).