[Bug middle-end/101836] __builtin_object_size(P->M, 1) where M is an array and the last member of a struct fails

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 14 07:25:47 GMT 2022


Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #24 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
For the default, a complication is that standard C++ doesn't allow neither
flexible array members nor zero sized arrays, so unless one uses extensions one
can only write [1].
I think differentiating between only allowing [] as flex, or [] and [0],
or [], [0] and [1], or any trailing array is useful.

More information about the Gcc-bugs mailing list