This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR 57748] Check for out of bounds access, Part 2
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Martin Jambor <mjambor at suse dot cz>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Sun, 13 Oct 2013 14:53:02 +0200
- Subject: Re: [PATCH, PR 57748] Check for out of bounds access, Part 2
- Authentication-results: sourceware.org; auth=none
- References: <20130910193228 dot GE6732 at virgil dot suse> <460555150 dot HNN3czQ0m7 at polaris> <DUB122-W2548785991FB4F41FF3D34E4190 at phx dot gbl>
> But if zero-sized arrays everywhere in a structure is valid C,
> then the attached test case is a valid test case.
Not necessarily, you can write the declaration but you cannot index the array,
i.e. this is undefined behavior. And there is nothing new, distinct fields
have been disambiguated in alias.c for ages.
--
Eric Botcazou