From 4d16dc867df299cb7b19db7aeaaff30e0eb599b8 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Mon, 6 May 2024 14:54:02 +0200 Subject: [PATCH 1/2] bcmserver: remove trailing whitespace --- bcmserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bcmserver.c b/bcmserver.c index 8b8288a..7241c78 100644 --- a/bcmserver.c +++ b/bcmserver.c @@ -194,7 +194,7 @@ int main(void) exit(1); } - while (1) { + while (1) { sa = accept(sl,(struct sockaddr *)&clientaddr, &sin_size); if (sa > 0 ){ if (!fork()) @@ -295,7 +295,7 @@ int main(void) items = sscanf(buf, format, ifr.ifr_name, - &cmd, + &cmd, &msg.msg_head.ival2.tv_sec, &msg.msg_head.ival2.tv_usec, &msg.msg_head.can_id, From e865e54490ce7cdaee8140edec6adfcd42bd9db9 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Mon, 6 May 2024 14:59:16 +0200 Subject: [PATCH 2/2] 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; | ^ --- bcmserver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bcmserver.c b/bcmserver.c index 7241c78..b07028f 100644 --- a/bcmserver.c +++ b/bcmserver.c @@ -155,10 +155,13 @@ int main(void) char format[FORMATSZ]; char rxmsg[50]; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wgnu-variable-sized-type-not-at-end" struct { struct bcm_msg_head msg_head; struct can_frame frame; } msg; +#pragma GCC diagnostic pop if (snprintf(format, FORMATSZ, "< %%%ds %%c %%lu %%lu %%x %%hhu " "%%hhx %%hhx %%hhx %%hhx %%hhx %%hhx "