Skip to content

boot/nxboot: fix Clang warnings for format and va_start#3419

Open
neilberkman wants to merge 1 commit intoapache:masterfrom
neilberkman:fix/nxboot-clang-warnings
Open

boot/nxboot: fix Clang warnings for format and va_start#3419
neilberkman wants to merge 1 commit intoapache:masterfrom
neilberkman:fix/nxboot-clang-warnings

Conversation

@neilberkman
Copy link

Summary

Fix two Clang -Werror failures when building nxboot with CONFIG_ARM_TOOLCHAIN_CLANG:

  • loader/flash.c: use PRIdOFF instead of %ld for off_t arguments in syslog calls, fixing -Wformat when off_t is not long.
  • nxboot_main.c / nxboot.h: change nxboot_progress parameter from enum progress_type_e to int to avoid undefined behavior from va_start on a parameter that undergoes default argument promotion (-Wvarargs).

Impact

Fixes build failures for any board config that enables nxboot with Clang (e.g. nucleo-h743zi/nxboot-loader, nucleo-h743zi/nxboot-app in apache/nuttx#18509).

Testing

Build: nucleo-h743zi/nxboot-loader and nucleo-h743zi/nxboot-app with CONFIG_ARM_TOOLCHAIN_CLANG.

Use PRIdOFF instead of %ld for off_t arguments in flash.c syslog
calls, fixing -Wformat errors when off_t is not long.

Change nxboot_progress parameter from enum progress_type_e to int
to avoid undefined behavior from va_start on a parameter that
undergoes default argument promotion (-Wvarargs).

Signed-off-by: Neil Berkman <neil@xuku.com>
Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

@cederom cederom requested a review from michallenc March 9, 2026 08:58
@cederom
Copy link
Contributor

cederom commented Mar 9, 2026

@michallenc could you please take a look as the code author? :-)

Copy link
Contributor

@michallenc michallenc left a comment

Choose a reason for hiding this comment

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

LGTM. The canceled checks in CI are correct?

@cederom
Copy link
Contributor

cederom commented Mar 9, 2026

Thank you @michallenc :-) GH CI is problematic recently. CI restarted :-)

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

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

Thank you @neilberkman :-) Lets just make sure CI pass fine :-)

@neilberkman
Copy link
Author

neilberkman commented Mar 9, 2026

Thank you @neilberkman :-) Lets just make sure CI pass fine :-)

Thanks! Unfortunately, looks like the rerun failed as well. This does all appear to be due to infrastructure issues, unrelated to the PR itself.

@cederom
Copy link
Contributor

cederom commented Mar 10, 2026

Yup GH seems to be doing some upgrades recently and lots of CI fails due to different reasons :-P

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants