On Fri, Nov 17, 2023 at 08:18:23AM -0800, Stephen Hemminger wrote: > On Fri, 17 Nov 2023 09:31:11 +0100 > Morten Brørup <m...@smartsharesystems.com> wrote: > > > Series-acked-by: Morten Brørup <m...@smartsharesystems.com> > > > > Suggest checkpatches to disallow this, if it doesn't already. > > Unfortunately, matching this with awk is too hard. Coccinelle can do it > but don't want to introduce dependency on that. > > Maybe a compiler flag would be possible, but could not find one.
-pedantic will warn, but to use it without clobbering the build with warnings we would probably need to qualify all use of non-standard extensions with the __extension__ keyword. ``` struct foo { int a; int b; char buffer[0]; }; ``` zhora ~> gcc -Wall -pedantic oink.c oink.c:7:14: warning: ISO C forbids zero-size array ‘buffer’ [-Wpedantic] 7 | char buffer[0];