[PATCH v2 3/3] examples/flow_filtering: fix gcc 15 overflow warning
Stephen Hemminger
stephen at networkplumber.org
Tue Jan 21 00:23:40 CET 2025
Gcc 15 no longer allows initialization of arrays with strings
because the null character is dropped. Resolve by using an
array initializer.
../examples/flow_filtering/snippets/snippet_match_mpls.c: In function ‘snippet_mpls_create_pattern_template’:
../examples/flow_filtering/snippets/snippet_match_mpls.c:62:31: warning: initializer-string for array of ‘unsigned char’ is too long [-Wunterminated-string-initialization]
62 | .label_tc_s = "\xff\xff\xf1",
| ^~~~~~~~~~~~~~
Fixes: 16158f349000 ("examples/flow_filtering: introduce use cases snippets")
Cc: shperetz at nvidia.com
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
examples/flow_filtering/snippets/snippet_match_mpls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/flow_filtering/snippets/snippet_match_mpls.c b/examples/flow_filtering/snippets/snippet_match_mpls.c
index a2e429f686..8382ec7041 100644
--- a/examples/flow_filtering/snippets/snippet_match_mpls.c
+++ b/examples/flow_filtering/snippets/snippet_match_mpls.c
@@ -59,7 +59,7 @@ snippet_mpls_create_pattern_template(uint16_t port_id, struct rte_flow_error *er
* the Traffic Class set to 0,
* and the Bottom of Stack bit set to 1.
*/
- .label_tc_s = "\xff\xff\xf1",
+ .label_tc_s = { 0xff, 0xff, 0xf1 },
};
/* Define the flow pattern template. */
--
2.45.2
More information about the dev
mailing list