-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[v3.0-branch] clang: Fix multiple warnings #21661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v3.0-branch] clang: Fix multiple warnings #21661
Conversation
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 1e8d7fd2fa35f1b25949eab27a1bd242543c380c more detailssdk-nrf:
nrfxlib:
zephyr:
Github labels
List of changed files detected by CI (8)
Outputs:ToolchainVersion: 7cbc0036f4 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
You can find the documentation preview for this PR here. |
34c2101
to
54f5637
Compare
Pull in changes from: nrfconnect/sdk-zephyr#2742 nrfconnect/sdk-nrfxlib#1716 Signed-off-by: Carles Cufi <[email protected]>
Safeguard `cracen_signature_set_hashalgo_from_digestsz()` and `cracen_signature_set_hashalgo()` inside `PSA_MAX_RSA_KEY_BITS > 0`. Safeguard `can_sign()` inside > CONFIG_PSA_WANT_ALG_PURE_EDDSA || `CONFIG_PSA_WANT_ALG_ED25519PH || > CONFIG_PSA_WANT_ALG_ECDSA || CONFIG_PSA_WANT_ALG_HMAC All calls to `cracen_signature_set_hashalgo()` and `cracen_signature_set_hashalgo_from_digestsz()` are safeguarded in `PSA_MAX_RSA_KEY_BITS > 0` resulting in unused function warning because those static functions will never be used when the condition is not met. Similar for calls to `can_sign()`. Fixes: > ...subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c:41:12: > warning: unused function > 'cracen_signature_set_hashalgo' [-Wunused-function] > 41 | static int cracen_signature_set_hashalgo(... > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 warning generated. > ...subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c:46:12: > warning: unused function > 'cracen_signature_set_hashalgo_from_digestsz' [-Wunused-function] > 46 | static int cracen_signature_set_hashalgo_from_digestsz(... > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 warning generated. > ...subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c:297:13: > warning: unused function 'can_sign' [-Wunused-function] > 297 | static bool can_sign(const psa_key_attributes_t *key_attr) > | ^~~~~~~~ > 1 warning generated. Signed-off-by: Torsten Rasmussen <[email protected]>
Verify return values for otPlatRadio* functions and log the error accordingly. For otPlatRadioTransmit() case, just log the error and let the entire TX procedure proceed on the next timeout. Signed-off-by: Robert Lubos <[email protected]>
Declaration of variables after a label inside a switch statement is a c23 extension, not c99. This results in the following warning when compiling with clang: > .../subsys/net/openthread/rpc/server/ot_rpc_netdiag.c:86:3: warning: > label followed by a declaration is a C23 extension [-Wc23-extensions] > 86 | uint8_t mode = 0; > | ^ > 1 warning generated. There are no practical reasons why the variable should be declared inside the switch statement, therefore move the declaration to top of function. Signed-off-by: Torsten Rasmussen <[email protected]>
54f5637
to
8a0606d
Compare
Add compiler definitions around algorithm selection This means only needed algorithms are checked at runtime Also means algorithm configs are required for importing keys Reduces size in most use cases Signed-off-by: Dag Erik Gjørvad <[email protected]>
Declaration of variables after a label inside a switch statement is a c23 extension, not c99. This results in the following warning when compiling with clang: > ..subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ecdsa.c:407:3: > warning: label followed by a declaration is a C23 extension > 407 | size_t copylen = MIN(digestsz, opsz - hmac_op->tlen); > | ^ > 1 warning generated. There is no practical reason why the variable should be declared inside the switch statement, therefore move the declaration and place it together with declaration of other variables. Signed-off-by: Torsten Rasmussen <[email protected]>
Backport of #21616
Including backport of #21099 to match other clang warning backport fixes.