[4/4] examples: add extension keyword to statement expressions

Message ID 1700089378-26197-5-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded
Delegated to: David Marchand
Headers
Series add __extension__ keyword to statement expressions |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Tyler Retzlaff Nov. 15, 2023, 11:02 p.m. UTC
  Add __extension__ keyword to gcc statement expression extensions.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 examples/fips_validation/fips_validation.c | 2 +-
 examples/ip_pipeline/parser.h              | 2 +-
 examples/pipeline/cli.c                    | 2 +-
 examples/qos_meter/main.h                  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index f840804..ba65d44 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -14,7 +14,7 @@ 
 #include "fips_validation.h"
 
 #define skip_white_spaces(pos)			\
-({						\
+__extension__ ({				\
 	__typeof__(pos) _p = (pos);		\
 	for ( ; isspace(*_p); _p++)		\
 		;				\
diff --git a/examples/ip_pipeline/parser.h b/examples/ip_pipeline/parser.h
index 5224b18..4b3fdff 100644
--- a/examples/ip_pipeline/parser.h
+++ b/examples/ip_pipeline/parser.h
@@ -14,7 +14,7 @@ 
 #define PARSE_DELIMITER				" \f\n\r\t\v"
 
 #define skip_white_spaces(pos)			\
-({						\
+__extension__ ({				\
 	__typeof__(pos) _p = (pos);		\
 	for ( ; isspace(*_p); _p++)		\
 		;				\
diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 2ae6cc5..57a5a53 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -46,7 +46,7 @@ 
 #define MSG_CMD_FAIL        "Command \"%s\" failed.\n"
 
 #define skip_white_spaces(pos)			\
-({						\
+__extension__ ({				\
 	__typeof__(pos) _p = (pos);		\
 	for ( ; isspace(*_p); _p++)		\
 		;				\
diff --git a/examples/qos_meter/main.h b/examples/qos_meter/main.h
index 864f019..59e5e0b 100644
--- a/examples/qos_meter/main.h
+++ b/examples/qos_meter/main.h
@@ -24,7 +24,7 @@  enum policer_action policer_table[RTE_COLORS][RTE_COLORS] =
 #if APP_MODE == APP_MODE_FWD
 
 #define FUNC_METER(m, p, time, pkt_len, pkt_color)	\
-({							\
+__extension__ ({					\
 	void *mp = m;					\
 	void *pp = p;					\
 	mp = mp;					\