Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printf_("%#.0o", 0) produces "", should produce "0" #109

Open
eyalroz opened this issue Jul 14, 2021 · 0 comments
Open

printf_("%#.0o", 0) produces "", should produce "0" #109

eyalroz opened this issue Jul 14, 2021 · 0 comments

Comments

@eyalroz
Copy link

eyalroz commented Jul 14, 2021

According to cppreference.com, and as implemented in glibc, the alternative mode for %o must ensure at least one leading zero is printed. Thus,

printf_("%#.0o", 0)

must produce "0", not "". And yet - the latter is produced.

@eyalroz eyalroz changed the title printf("%#.0o", 0) produces "", should produce "0" printf_("%#.0o", 0) produces "", should produce "0" Jul 14, 2021
eyalroz pushed a commit to eyalroz/printf that referenced this issue Jul 14, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz pushed a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz pushed a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Jul 30, 2021
eyalroz referenced this issue in eyalroz/printf Jul 31, 2021
* Added a couple of test cases for exposing the behavior of the `#` modifier (alternative mode) together with `ll` (long long modifier), and specifically exposing the example format string mentioned in bug #114.
* Our fix for #109 was too eager to keep `FLAG_HASH` - it dropped it only when a precision wasn't specified. We're now going part of the way back - dropping `FLAG_HASH` even when precision wasn't specific - except for octal.
* The `long long` version of ntoa now behaves just like the `long` version.
eyalroz referenced this issue in eyalroz/printf Jul 31, 2021
* Added a couple of test cases for exposing the behavior of the `#` modifier (alternative mode) together with `ll` (long long modifier), and specifically exposing the example format string mentioned in bug #114.
* Our fix for #109 was too eager to keep `FLAG_HASH` - it dropped it only when a precision wasn't specified. We're now going part of the way back - dropping `FLAG_HASH` even when precision wasn't specific - except for octal.
* The `long long` version of ntoa now behaves just like the `long` version.
eyalroz pushed a commit to eyalroz/printf that referenced this issue Aug 3, 2021
eyalroz added a commit to eyalroz/printf that referenced this issue Aug 3, 2021
eyalroz referenced this issue in eyalroz/printf Aug 3, 2021
* Added a couple of test cases for exposing the behavior of the `#` modifier (alternative mode) together with `ll` (long long modifier), and specifically exposing the example format string mentioned in bug #114.
* Our fix for #109 was too eager to keep `FLAG_HASH` - it dropped it only when a precision wasn't specified. We're now going part of the way back - dropping `FLAG_HASH` even when precision wasn't specific - except for octal.
* The `long long` version of ntoa now behaves just like the `long` version.
KarlK90 pushed a commit to qmk/printf that referenced this issue Jul 7, 2022
… exponent. CAVEAT: This exposes an issue with printing values having exponent -308 (the minimum exponent for double's); and - we see some divergence from perfect corrtness with higher precision values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant