sys/stdio: add printf_long_long #21445
Merged
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_long
module that can be used to enable printing oflong long
andunsigned 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-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
andprintf_long_long
, which would come for some memory cost.On 64 bit and 32 bit systems,
mpaland-printf
addsprintf_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