On Wed, 8 Aug 2018, Martin Sebor wrote: > Jason/Joseph, is this meant to be accepted? It's rejected with > a hard error with -Wpedantic but I don't see any tests for it: > > warning: ISO C forbids empty initializer braces [-Wpedantic] > const char x[] = { }; > ^ > error: zero or negative size array ‘b’ > const char x[] = { }; > ^ > > I'll avoid handling it but I'm not sure I should add a test case > for it if it's accepted by mistake (and if I should open a bug > to reject it instead).
It's a perfectly ordinary combination of two GNU extensions (zero-size arrays, and empty initializer braces), so yes, it should be accepted, and have size 0 (but -pedantic should produce a pedwarn, not a hard error). -- Joseph S. Myers jos...@codesourcery.com