Skip to content

Conversation

carlescufi
Copy link
Contributor

@carlescufi carlescufi commented Apr 10, 2025

Backport of #21616

Including backport of #21099 to match other clang warning backport fixes.

@carlescufi carlescufi requested review from a team as code owners April 10, 2025 18:41
@github-actions github-actions bot added manifest changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Apr 10, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Apr 10, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
nrfxlib nrfconnect/sdk-nrfxlib@b90a624 nrfconnect/sdk-nrfxlib@5f9842b (v3.0-branch) nrfconnect/[email protected]
zephyr nrfconnect/sdk-zephyr@9ad6673 nrfconnect/sdk-zephyr@4ff1c36 (v4.0.99-ncs1-branch) nrfconnect/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Apr 10, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 5

Inputs:

Sources:

sdk-nrf: PR head: 1e8d7fd2fa35f1b25949eab27a1bd242543c380c
nrfxlib: PR head: 5f9842bf8fa8e1ed1883c1e65e7a61fcb1c7e4e2
zephyr: PR head: 4ff1c3616aeecb52617d87bfdf2da0435f36fb17

more details

sdk-nrf:

PR head: 1e8d7fd2fa35f1b25949eab27a1bd242543c380c
merge base: 88f87b4e8e848bda6de33b47e4d99fdea6037fea
target head (v3.0-branch): 88f87b4e8e848bda6de33b47e4d99fdea6037fea
Diff

nrfxlib:

PR head: 5f9842bf8fa8e1ed1883c1e65e7a61fcb1c7e4e2
merge base: b90a6248dcb5caa7e8b17d1e24b01703508170e4
Diff

zephyr:

PR head: 4ff1c3616aeecb52617d87bfdf2da0435f36fb17
merge base: 9ad6673058ccaee61f976bcb3d6d203be94bfdc7
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (8)
modules
│  ├── openthread
│  │  ├── platform
│  │  │  │ diag.c
nrfxlib
│  ├── nrf_802154
│  │  ├── driver
│  │  │  ├── src
│  │  │  │  ├── mac_features
│  │  │  │  │  │ nrf_802154_delayed_trx.c
subsys
│  ├── net
│  │  ├── openthread
│  │  │  ├── rpc
│  │  │  │  ├── server
│  │  │  │  │  │ ot_rpc_netdiag.c
│  ├── nrf_security
│  │  ├── src
│  │  │  ├── drivers
│  │  │  │  ├── cracen
│  │  │  │  │  ├── cracenpsa
│  │  │  │  │  │  ├── src
│  │  │  │  │  │  │  ├── ecdsa.c
│  │  │  │  │  │  │  ├── kmu.c
│  │  │  │  │  │  │  │ sign.c
west.yml
zephyr
│  ├── subsys
│  │  ├── net
│  │  │  ├── lib
│  │  │  │  ├── zperf
│  │  │  │  │  │ zperf_shell.c

Outputs:

Toolchain

Version: 7cbc0036f4
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:7cbc0036f4_8bf7ca4353

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 1789
    • sdk-zephyr test count: 1283
  • ❌ Integration tests
    • ✅ test-fw-nrfconnect-chip
    • ✅ test-fw-nrfconnect-nfc
    • ✅ test-fw-nrfconnect-nrf-iot_cloud
    • ✅ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • ✅ test-fw-nrfconnect-nrf-iot_samples
    • ✅ test-fw-nrfconnect-nrf-iot_thingy91
    • ❌ test-fw-nrfconnect-nrf_crypto
    • ✅ test-fw-nrfconnect-rs
    • ✅ test-fw-nrfconnect-fem
    • ✅ test-fw-nrfconnect-tfm
    • ✅ test-fw-nrfconnect-thread
    • ✅ test-sdk-find-my
    • ✅ test-fw-nrfconnect-nrf-iot_mosh
    • ✅ test-fw-nrfconnect-nrf-iot_positioning
    • ✅ test-sdk-dfu
    • ❌ test-fw-nrfconnect-ps
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-rpc
    • test-low-level
    • test-sdk-audio
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

Copy link

You can find the documentation preview for this PR here.

@tejlmand tejlmand force-pushed the clang-warning-fixes branch 3 times, most recently from 34c2101 to 54f5637 Compare April 11, 2025 09:43
carlescufi and others added 4 commits April 11, 2025 14:40
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]>
degjorva and others added 2 commits April 11, 2025 15:03
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]>
@carlescufi carlescufi merged commit 8091688 into nrfconnect:v3.0-branch Apr 11, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. manifest manifest-nrfxlib manifest-zephyr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants