This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/67882] surprising offsetof result on an invalid array member without diagnostic


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]