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_("%#.4o", 1) produces "00001", should produce "0001" #110

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

printf_("%#.4o", 1) produces "00001", should produce "0001" #110

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 - but it doesn't increase the precision if a leading zero is already printed. Thus,

printf_("%#.4o", 1)

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

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
* Split the "float" testcase into several cases regarding float-point specifiers.
* Renamed "types" -> "integer types
* Added a few testcases with non-numeric floating-point values and the `E` specifier.
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