Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-06 Thread Qing Zhao via Gcc-patches
Sorry, Please ignore this email. Qing > On Dec 6, 2022, at 11:14 AM, Qing Zhao wrote: > > '-Wstrict-flex-arrays' > Warn about inproper usages of flexible array members according to > the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to > the trailing array field of a s

[V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-06 Thread Qing Zhao via Gcc-patches
'-Wstrict-flex-arrays' Warn about inproper usages of flexible array members according to the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to the trailing array field of a structure if it's available, otherwise according to the LEVEL of the option '-fstrict-fl

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-05 Thread Qing Zhao via Gcc-patches
> On Dec 5, 2022, at 10:16 AM, Richard Biener wrote: > > On Fri, 2 Dec 2022, Qing Zhao wrote: > >> >> >>> On Dec 2, 2022, at 2:20 AM, Richard Biener wrote: >>> >>> On Fri, 2 Dec 2022, Richard Biener wrote: >>> On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: > On 2022-12-01 1

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-05 Thread Richard Biener via Gcc-patches
On Fri, 2 Dec 2022, Qing Zhao wrote: > > > > On Dec 2, 2022, at 2:20 AM, Richard Biener wrote: > > > > On Fri, 2 Dec 2022, Richard Biener wrote: > > > >> On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: > >> > >>> On 2022-12-01 11:42, Kees Cook wrote: > On Wed, Nov 30, 2022 at 02:25:56PM +

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-02 Thread Qing Zhao via Gcc-patches
> On Dec 2, 2022, at 2:20 AM, Richard Biener wrote: > > On Fri, 2 Dec 2022, Richard Biener wrote: > >> On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: >> >>> On 2022-12-01 11:42, Kees Cook wrote: On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: > '-Wstrict-flex-arrays' >

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-02 Thread Qing Zhao via Gcc-patches
> On Dec 2, 2022, at 2:16 AM, Richard Biener wrote: > > On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: > >> On 2022-12-01 11:42, Kees Cook wrote: >>> On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: '-Wstrict-flex-arrays' Warn about inproper usages of flexible array me

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Richard Biener via Gcc-patches
On Fri, 2 Dec 2022, Richard Biener wrote: > On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: > > > On 2022-12-01 11:42, Kees Cook wrote: > > > On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: > > >> '-Wstrict-flex-arrays' > > >> Warn about inproper usages of flexible array members ac

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Richard Biener via Gcc-patches
On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: > On 2022-12-01 11:42, Kees Cook wrote: > > On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: > >> '-Wstrict-flex-arrays' > >> Warn about inproper usages of flexible array members according to > >> the LEVEL of the 'strict_flex_arr

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Siddhesh Poyarekar
On 2022-12-01 18:19, Kees Cook wrote: On Thu, Dec 01, 2022 at 10:27:41PM +, Qing Zhao wrote: Hi, Sid, Thanks a lot for the input. After more thinking based on your and Kees’ comments, I have the following thought: 1. -fstrict-flex-arrays=level should control both GCC code gen and warning

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Kees Cook via Gcc-patches
On Thu, Dec 01, 2022 at 10:27:41PM +, Qing Zhao wrote: > Hi, Sid, > > Thanks a lot for the input. > > After more thinking based on your and Kees’ comments, I have the following > thought: > > 1. -fstrict-flex-arrays=level should control both GCC code gen and warnings > consistently; > 2. W

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Qing Zhao via Gcc-patches
Hi, Sid, Thanks a lot for the input. After more thinking based on your and Kees’ comments, I have the following thought: 1. -fstrict-flex-arrays=level should control both GCC code gen and warnings consistently; 2. We need warnings specifically for -fstrict-flex-arrays=level to report any misu

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Siddhesh Poyarekar
On 2022-12-01 11:42, Kees Cook wrote: On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: '-Wstrict-flex-arrays' Warn about inproper usages of flexible array members according to the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to the trailing array field

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Qing Zhao via Gcc-patches
Richard, What’s your opinion on this? Do we need one separate warning option to report the misuse of flexible array member only? Or we just combine such warnings into -Warray-bounds when it combines with -fstrict-flex-arrays? Thanks. Qing > On Dec 1, 2022, at 12:18 PM, Kees Cook wrote: > >

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Kees Cook via Gcc-patches
On Thu, Dec 01, 2022 at 05:04:02PM +, Qing Zhao wrote: > > > > On Dec 1, 2022, at 11:42 AM, Kees Cook wrote: > > > > On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: > >> '-Wstrict-flex-arrays' > >> Warn about inproper usages of flexible array members according to > >> the

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Qing Zhao via Gcc-patches
> On Dec 1, 2022, at 11:42 AM, Kees Cook wrote: > > On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: >> '-Wstrict-flex-arrays' >> Warn about inproper usages of flexible array members according to >> the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to >> the

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Kees Cook via Gcc-patches
On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: > '-Wstrict-flex-arrays' > Warn about inproper usages of flexible array members according to > the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to > the trailing array field of a structure if it's available, >

[V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-11-30 Thread Qing Zhao via Gcc-patches
'-Wstrict-flex-arrays' Warn about inproper usages of flexible array members according to the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to the trailing array field of a structure if it's available, otherwise according to the LEVEL of the option '-fstrict-fl