Subject: lib/22019: printf C99 conformance with %#.o
To: None <>
From: Johan Danielsson <>
List: netbsd-bugs
Date: 06/30/2003 15:49:33
>Number:         22019
>Category:       lib
>Synopsis:       printf C99 conformance with %#.o
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 30 13:50:02 UTC 2003
>Originator:     Johan Danielsson
>Release:        NetBSD 1.6T
	<The following information is extracted from your kernel. Please>
	<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD 1.6T NetBSD 1.6T (BLUBB) #531: Thu May 29 13:09:25 CEST 2003 i386
Architecture: i386
Machine: i386

Currently printf("%#.o", 0) produces the empty string (""), and this
is correct in terms of C89, but C99 includes this piece of text: "if
the value and precision are both 0, a single 0 is printed". This
indicates that the output should be "0".

But I'm not sure I think this makes much sense. For instance "%#.x"
would still result in "".

So either we should fix printf to comply with C99, or we should decide
that this is just rubbish. I have not seen a rationale for C99, so I
don't know why this change was made.

#include <stdio.h>

    printf("|%#.o|\n", 0);


None supplied.
 	<Please check that the above is correct for the bug being reported,>
 	<and append source date of snapshot, if applicable (one line).>