https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78910
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2016-12-23 Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Thanks! Precision gives the minimum number of digits with d, which doesn't include the sign, so printf("%.2d", -1) should produce the three bytes "-01".