https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111022
--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- The relative text in the standard is: 13.7.2.1 General rules --- snip --- (6) On output, with I, B, O, Z, D, E, EN, ES, EX, F, and G editing, the specified value of the field width w may be zero. In such cases, the processor selects the smallest positive actual field width that does not result in a field filled with asterisks. The specified value of w shall not be zero on input.