Subject: bin/9487: GCC doesn't know strftime(3)'s "%F" conversion
To: None <gnats-bugs@gnats.netbsd.org>
From: NAKAJIMA Yoshihiro <nakayosh@kcn.ne.jp>
List: netbsd-bugs
Date: 02/25/2000 09:02:10
>Number:         9487
>Category:       bin
>Synopsis:       GCC doesn't know strftime(3)'s "%F" conversion
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 25 09:00:01 2000
>Last-Modified:
>Originator:     NAKAJIMA Yoshihiro
>Organization:
>Release:        NetBSD-current 2000/02/22
>Environment:
System: NetBSD asura 1.4T NetBSD 1.4T (ASURA) #0: Wed Feb 23 21:14:16 JST 2000 nakayosh@asura:/usr/src/sys/arch/i386/compile/ASURA i386


>Description:

	GCC doesn't know strftime(3)'s "%F" conversion.
	GCC warns its use.

>How-To-Repeat:

% cat test.c
#include <time.h>

int main(void)
{
    char buffer[32];
    time_t now = time(NULL);

    strftime(buffer, sizeof buffer, "%F", localtime(&now));

    return 0;
}
% cc -Wall test.c
test.c: In function `main':
test.c:8: warning: unknown conversion type character `F' in format
% 

>Fix:

diff -u src/gnu/dist/gcc/c-common.c.ORIG src/gnu/dist/gcc/c-common.c
--- src/gnu/dist/gcc/c-common.c.ORIG	Tue Jun 29 08:57:07 1999
+++ src/gnu/dist/gcc/c-common.c	Fri Feb 26 01:52:36 2000
@@ -1054,7 +1054,7 @@
   { "D", 		0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "2" },
   { "g", 		0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "2O-_0w" },
   { "cx", 		0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "3E" },
-  { "%RTXnrt",		0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "" },
+  { "%FRTXnrt",		0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "" },
   { "P",		0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "G" },
   { "HIMSUWdemw",	0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Ow" },
   { "Vju",		0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Oow" },

>Audit-Trail:
>Unformatted: