sys/stdio: add printf_long_long#21445
Merged
Enoch247 merged 1 commit intoRIOT-OS:masterfrom Apr 28, 2025
Merged
Conversation
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.
1 task
Member
Author
|
Thx a lot :) |
Contributor
|
I'm not sure the Doxygen documentation worked 100% yet: https://ci.riot-os.org/results/91d6e5792af14b2f9ec793d4a95f16ad/doc-preview/group__sys__stdio__printf__float.html (That's all that is shown on the page.) |
Member
Author
|
Indeed, that is the kind of bad UX that @Teufelchen1 referred to. I'll open a PR to fix that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Contribution description
This adds the new
printf_long_longmodule that can be used to enable printing oflong longandunsigned long long.This has been implemented for
mpaland-printf. In addition, this module is a default module for 32-bit and 64-bit systems ifmpaland-printfis 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-printfwould require more memory than newlib's implementation.Testing procedure
Now on MSP430, adding
USEPKG += mpaland-printfshould 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-printfandprintf_long_long, which would come for some memory cost.On 64 bit and 32 bit systems,
mpaland-printfaddsprintf_long_longto 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