https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81234
Jonathan Wakely changed:
What|Removed |Added
Keywords||rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed||2017-06-27
Known to work||6.3.1
Summary|[regression] flexible array |[7/8 Regression] flexible
|member not at end of|array member not at end of
|‘struct |‘struct
Ever confirmed|0 |1
Known to fail||7.1.0, 8.0
--- Comment #1 from Jonathan Wakely ---
The code is valid in C, so presumably should be valid with G++ too.
GCC 6 gives a warning with -pedantic, but prints the accompanying notes even
without -pedantic!
$ g++ foo.c -pedantic
foo.c:4:27: warning: flexible array member ‘DataPacket::data’ not at end of
‘struct AckPacket’ [-Wpedantic]
char data[];
^
foo.c:9:21: note: next member ‘int AckPacket::a’ declared here
int a,b,c;
^
foo.c:7:16: note: in the definition of ‘struct AckPacket’
struct AckPacket {
^
$ g++ foo.c
foo.c:9:21: note: next member ‘int AckPacket::a’ declared here
int a,b,c;
^
foo.c:7:16: note: in the definition of ‘struct AckPacket’
struct AckPacket {
^