bcmserver: use pragma to silence gnu-variable-sized-type-not-at-end warning

Silence the following warning by switching it of via a pragma.

| bcmserver.c:159:23: warning: field 'msg_head' with variable sized
| type 'struct bcm_msg_head' not at the end of a struct or class is a
| GNU extension [-Wgnu-variable-sized-type-not-at-end]
|            struct bcm_msg_head msg_head;
|                                ^
pull/517/head
Marc Kleine-Budde 2024-05-06 14:59:16 +02:00
parent 4d16dc867d
commit e865e54490
1 changed files with 3 additions and 0 deletions

View File

@ -155,10 +155,13 @@ int main(void)
char format[FORMATSZ]; char format[FORMATSZ];
char rxmsg[50]; char rxmsg[50];
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wgnu-variable-sized-type-not-at-end"
struct { struct {
struct bcm_msg_head msg_head; struct bcm_msg_head msg_head;
struct can_frame frame; struct can_frame frame;
} msg; } msg;
#pragma GCC diagnostic pop
if (snprintf(format, FORMATSZ, "< %%%ds %%c %%lu %%lu %%x %%hhu " if (snprintf(format, FORMATSZ, "< %%%ds %%c %%lu %%lu %%x %%hhu "
"%%hhx %%hhx %%hhx %%hhx %%hhx %%hhx " "%%hhx %%hhx %%hhx %%hhx %%hhx %%hhx "