[[GCC13][Patch][V3] 1/2] Add a new option -fstrict-flex-array[=n] and new attribute strict_flex_array

Qing Zhao qing.zhao@oracle.com
Wed Aug 31 20:16:49 GMT 2022


Okay, I am fine with this.

Richard and Kees,  what’s your opinion on this?

thanks.

Qing

> On Aug 31, 2022, at 4:09 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> 
> On Wed, 31 Aug 2022, Qing Zhao wrote:
> 
>>>> When -std=gnu89 + -fstrict-flex-array=3 (ONLY C99 flexible array member 
>>>> [] is treated as a valid flexible array) present together,
>>> 
>>> That seems reasonable enough without a warning.  If people want a warning 
>>> for flexible array members in older language modes, they can use 
>>> -pedantic; I don't think we need to warn for any particular 
>>> -fstrict-flex-array modes there.
>> 
>> So, you mean,
>> 
>> 1. GCC with -std=gnu89 support all [0], [1], and [] as Flexible array member;
>> 2. Therefore. -std=gnu89 + -fstrict-flex-array=3 does not need a warning;
>> 
>> ?
> 
> Yes.
> 
>> Then, how about:
>> 
>> -std=c89:
>> 
>> 1. GCC with -std=c89 also support all [0], [1], and [] as Flexible array member;
>> 2, therefore, -std=c89 + -fstrict-flex-array does not need a warning too.
>> 
>> ?
> 
> Yes.
> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com



More information about the Gcc-patches mailing list