This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/67882] surprising offsetof result on an invalid array member without diagnostic
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Nov 2015 18:53:51 +0000
- Subject: [Bug c/67882] surprising offsetof result on an invalid array member without diagnostic
- Auto-submitted: auto-generated
- References: <bug-67882-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67882
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Tue Nov 3 18:53:19 2015
New Revision: 229717
URL: https://gcc.gnu.org/viewcvs?rev=229717&root=gcc&view=rev
Log:
PR c++-common/67882
* c-family/c-common.h (fold_offsetof_1): Add argument.
* c-family/c-common.c (fold_offsetof_1): Diagnose more invalid
offsetof expressions that reference elements past the end of
an array.
* c-c++-common/builtin-offsetof-2.c: New test.
Added:
trunk/gcc/testsuite/c-c++-common/builtin-offsetof-2.c
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/c-family/c-common.h
trunk/gcc/testsuite/ChangeLog