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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to qinzhao from comment #9)
> (In reply to Jakub Jelinek from comment #8)
> > Well, -fsanitize=bounds-strict certainly shouldn't imply
> > -fstrict-flex-arrays=2,
> > it should just treat [1] and [4] (but I think it does even [0] right now) as
> > regular arrays for the purposes of the sanitization.
> 
> with a small example I just tested, with -fsanitize=bounds-strict, I can
> see, it treats:
>    [], [0] as flexible array members;
> but
>    [1], [4] as regular arrays
> 
> This is the same level as -fstrict-flex-arrays=2. 
> should we just keep its default behavior like this, or let it more strictly
> as -fstrict-flex-arrays=3?

I'd keep its current behavior, perhaps except for -fsanitize=bounds-strict
-fstrict-flex-arrays{,=3} so that -fsanitize=bounds -fstrict-flex-arrays{,=3}
wouldn't be more strict than the former.

Reply via email to