This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Fix some printf formatting codes for size_t/ssize_t. #17
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.
This commit switches to using "%zu" and "%zd" for printing size_t and ssize_t,
respectively. These format codes are more portable than "%u" or "%d". For
example, on x86_64 size_ts and ssize_ts are 64-bit values, while ints are 32-bit
values. In practice, this does not cause problems in the x86_64 System V ABI
because 32-bit values are naturally extended in this scenario, but on other
platforms it can cause stack corruption.
If you're happy to accept this, I believe I need to sign a CLA, but it's not clear to me where to get this from. Are you able to point me in the right direction? Thanks.Also, I inadvertently picked this up after slapping
__attribute__((format(printf, 3, 4)))
on thesignal_log
declaration. I assumed you don't want GNU-isms like this in the code base so I didn't commit this as well, but please let me know if you'd like me to include that change as well.