Skip to content

dp_rte_flow_helpers: Explicit array initialization#780

Open
mkalcok wants to merge 1 commit into
mainfrom
explicit-array-init
Open

dp_rte_flow_helpers: Explicit array initialization#780
mkalcok wants to merge 1 commit into
mainfrom
explicit-array-init

Conversation

@mkalcok

@mkalcok mkalcok commented Jun 10, 2026

Copy link
Copy Markdown

GCC 15 introduces 'unterminated-string-initialization'[0] warning and since we treat warning as errors in our builds, we might as well get ahead of the issue and change from string literals to explicit array initialization.

[0] https://gcc.gnu.org/cgit/gcc/commit/?id=44c9403ed1833ae71a59e84f9e37af3182be0df5

Proposed Changes

  • Use explicit byte array initialization instead of string literals.

GCC 15 introduces 'unterminated-string-initialization'[0] warning and since
we treat warning as errors in our builds, we might as well get ahead of
the issue and change from string literals to explicit array
initialization.

[0] https://gcc.gnu.org/cgit/gcc/commit/?id=44c9403ed1833ae71a59e84f9e37af3182be0df5

Signed-off-by: Martin Kalcok <martin.kalcok@sap.com>
@PlagueCZ

Copy link
Copy Markdown
Contributor

Makes sense.

But needs to be tested to be 100% sure, because this is offloading related and thus test suite is not able to test this.

@PlagueCZ

PlagueCZ commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

So I tested it and this is a no-op change.

Methodology (thank you Claude):

git switch main
ninja -C build
objdump -s -j .rodata build/src/dpservice-bin >/tmp/pre
git switch explicit-array-init
ninja -C build
objdump -s -j .rodata build/src/dpservice-bin >/tmp/post
diff /tmp/pre /tmp/post

This results in a diff with only the git hash changing:

4098,4099c4098,4099
<  224fd0 302e332e 32322d38 2d673662 33616132  0.3.22-8-g6b3aa2
<  224fe0 39300000 00000000 476f7420 696e7661  90......Got inva
---
>  224fd0 302e332e 32322d39 2d676534 35643837  0.3.22-9-ge45d87
>  224fe0 30350000 00000000 476f7420 696e7661  05......Got inva
9563,9564c9563,9564
<  23a560 302e332e 32322d38 2d673662 33616132  0.3.22-8-g6b3aa2
<  23a570 39300044 50205365 72766963 65207665  90.DP Service ve
---
>  23a560 302e332e 32322d39 2d676534 35643837  0.3.22-9-ge45d87
>  23a570 30350044 50205365 72766963 65207665  05.DP Service ve
11145c11145
<  240840 2e32322d 382d6736 62336161 32393000  .22-8-g6b3aa290.
---
>  240840 2e32322d 392d6765 34356438 37303500  .22-9-ge45d8705.

To double check (the test and the AI):

# edit include/rte_flow/dp_rte_flow_helpers.h and replace single 0xff with 0xfe
ninja -C build
objdump -s -j .rodata build/src/dpservice-bin >/tmp/post
diff /tmp/pre /tmp/post

this results in

$ diff /tmp/pre /tmp/post
8492c8492
<  236270 ffffffff ffff0000 00000000 ffff0000  ................
---
>  236270 ffffffff fffe0000 00000000 ffff0000  ................
8598c8598
<  236910 ffffffff ffff0000 00000000 ffff0000  ................
---
>  236910 ffffffff fffe0000 00000000 ffff0000  ................
8790c8790
<  237510 ffffffff ffff0000 00000000 ffff0000  ................
---
>  237510 ffffffff fffe0000 00000000 ffff0000  ................
8940c8940
<  237e70 ffffffff ffff0000 00000000 ffff0000  ................
---
>  237e70 ffffffff fffe0000 00000000 ffff0000  ................
9036c9036
<  238470 ffffffff ffff0000 00000000 ffff0000  ................
---
>  238470 ffffffff fffe0000 00000000 ffff0000  ................
9234c9234
<  2390d0 ffffffff ffff0000 00000000 ffff0000  ................
---
>  2390d0 ffffffff fffe0000 00000000 ffff0000  ................

@PlagueCZ PlagueCZ marked this pull request as ready for review June 21, 2026 20:53
@PlagueCZ PlagueCZ requested a review from a team as a code owner June 21, 2026 20:53

@PlagueCZ PlagueCZ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creates no change in generated machine code. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants