Skip to content

Conversation

@luismarques
Copy link
Contributor

Adds the nonstring attribute through a new OT_NONSTRING macro. This is used to prevent warnings when compiling with Clang 21+ and an array is initialized with a string literal but is sized not to include the terminating null.

@luismarques luismarques requested a review from a team as a code owner July 6, 2025 21:15
@luismarques luismarques requested review from engdoreis and removed request for a team July 6, 2025 21:15
Adds the `nonstring` attribute through a new `OT_NONSTRING` macro.
This is used to prevent warnings when compiling with Clang 21+ and an
array is initialized with a string literal but is sized not to
include the terminating null.

Signed-off-by: Luís Marques <[email protected]>
@jwnrt
Copy link
Contributor

jwnrt commented Jul 7, 2025

Looks okay, thanks

@marnovandermaas found a lot of byte strings which don't explicitly list the array size and might not trigger the warnings. I don't know if we want to do anything about these.

They're mostly KMAC tests:

sw/device/tests/kmac_entropy_stress_test.c

Copy link
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

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

I have a related PR for KMAC here: #27558
That one still needs some fixing because the test was actually wrong in the first place and is now failing. So probably best to get this PR in first and then I can keep working on the KMAC one.

@luismarques luismarques merged commit 2df6501 into lowRISC:master Jul 7, 2025
45 checks passed
@luismarques luismarques added the CherryPick:earlgrey_1.0.0 This PR should be cherry-picked to earlgrey_1.0.0 label Oct 24, 2025
@lowrisc-ci
Copy link

lowrisc-ci bot commented Oct 24, 2025

Successfully created backport PR for earlgrey_1.0.0:

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

Labels

CherryPick:earlgrey_1.0.0 This PR should be cherry-picked to earlgrey_1.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants