[Bug c/107951] Invalid flexible array use not detected in nested structs by the C frontend

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 2 14:44:38 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107951

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
                 CC|                            |jsm28 at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
> ./cc1 -quiet t.c -pedantic-errors
t.c:7:6: error: invalid use of structure with flexible array member
[-Wpedantic]
    7 |   F2 flex;
      |      ^~~~

so this is supposedly a GCC extension, treating [] as [0] in this context?


More information about the Gcc-bugs mailing list