Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Change %1d to %d #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Change %1d to %d #24

wants to merge 1 commit into from

Conversation

kilojoules
Copy link

@kilojoules kilojoules commented Jul 1, 2018

Is this a bug? Why set the minimum width this way, especially with -Werror activated?

%1d is never different from %d: setting the minimum width to 1 is redundant. http://www.kurabiyeaski.com/ym/201501/a_Meaning_of__1d_in_printf_statement_in__c__.html).

%.1d would also be redundant: it sets the minimum number of digits to 1 (http://man7.org/linux/man-pages/man3/printf.3.html), but %d already always prints at least 1 digit and maybe a sign.

Thanks to Peter Cordes for helping me put this issue together.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant