glibc’s printf("% .0d",0) prints a space, and printf("%+.0d",0) prints a plus sign, and the glib printf test checks for this behavior. But is it correct? From the standard (7.19.6.1):
+ The result of a signed conversion always begins with a plus or minus sign. (It begins with a sign only when a negative value is converted if this flag is not specified.)
space If the first character of a signed conversion is not a sign, or if a signed conversion results in no characters, a space is prefixed to the result. If the space and + flags both appear, the space flag is ignored.
However, regarding precision for the d specifier:
The result of converting a zero value with a precision of zero is no characters.
Naturally this "no characters" rule does not preclude padding the field to the requested width, but as far as I can tell, the prefixed space or + is part of the conversion, and thus subject to the "no characters" rule.
Has this matter ever been clarified?
No, it’s talking about the basic conversion without modifiers; that’s why the modifiers specifically say what they do when the basic conversion produces no characters.