Skip to content

Conversation

maribu
Copy link
Member

@maribu maribu commented Apr 27, 2025

Contribution description

This adds the new printf_long_long module that can be used to enable printing of long long and unsigned long long.

This has been implemented for mpaland-printf. In addition, this module is a default module for 32-bit and 64-bit systems if mpaland-printf is used, 64 bit support is not too expensive for them. (And on 64-bit systems support for long long is needed for support of %p, which is pretty basic.)

This is mainly useful for MSP430, where otherwise mpaland-printf would require more memory than newlib's implementation.

Testing procedure

Now on MSP430, adding USEPKG += mpaland-printf should reduce memory requirements instead of increasing them, at the cost of not supporting 64 bit numbers. (But that is also the case without it, so this is fair game.)

Users who want 64 bit support on MSP430 can now use mpaland-printf and printf_long_long, which would come for some memory cost.

On 64 bit and 32 bit systems, mpaland-printf adds printf_long_long to the default modules. In other words: 64 bit printing is opt-out when it is cheap, and opt-in when it is costly.

Issues/PRs references

None

This adds the new `printf_long_long` module that can be used to enable
printing of `long long` and `unsigned long long`.

This has been implemented for `mpaland-printf`. In addition, this module
is a default module for 32-bit and 64-bit systems if `mpaland-printf` is
used, 64 bit support is not too expensive for them. (And on 64-bit
systems support for long long is needed for support of `%p`, which is
pretty basic.)

This is mainly useful for MSP430, where otherwise `mpaland-printf` would
require more memory than newlib's implementation.
@maribu maribu added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 27, 2025
@github-actions github-actions bot added Area: build system Area: Build system Area: pkg Area: External package ports labels Apr 27, 2025
@riot-ci
Copy link

riot-ci commented Apr 27, 2025

Murdock results

✔️ PASSED

b9b488d sys/stdio: add printf_long_long

Success Failures Total Runtime
10320 0 10320 13m:40s

Artifacts

Copy link
Contributor

@Enoch247 Enoch247 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@Enoch247 Enoch247 added this pull request to the merge queue Apr 27, 2025
Merged via the queue into RIOT-OS:master with commit b71874b Apr 28, 2025
28 checks passed
@maribu maribu deleted the pkg/mpaland-printf/configure-long-long branch April 28, 2025 04:57
@maribu
Copy link
Member Author

maribu commented Apr 28, 2025

Thx a lot :)

@crasbe
Copy link
Contributor

crasbe commented Apr 28, 2025

@maribu
Copy link
Member Author

maribu commented Apr 28, 2025

Indeed, that is the kind of bad UX that @Teufelchen1 referred to. I'll open a PR to fix that.

@Teufelchen1 Teufelchen1 added this to the Release 2025.07 milestone Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants