Suppress a warning that some versions of gcc emit about %x in strftime.
Per suggestion from Alvaro.
This commit is contained in:
parent
31013db0a1
commit
05c4d8f783
|
@ -42,7 +42,7 @@
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
* Portions taken from FreeBSD.
|
* Portions taken from FreeBSD.
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.137 2007/05/31 15:13:03 petere Exp $
|
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.138 2007/07/11 23:15:38 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -2155,6 +2155,13 @@ escape_quotes(const char *src)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Hack to suppress a warning about %x from some versions of gcc */
|
||||||
|
static inline size_t
|
||||||
|
my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
|
||||||
|
{
|
||||||
|
return strftime(s, max, fmt, tm);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine likely date order from locale
|
* Determine likely date order from locale
|
||||||
*/
|
*/
|
||||||
|
@ -2184,7 +2191,7 @@ locale_date_order(const char *locale)
|
||||||
testtime.tm_mon = 10; /* November, should come out as "11" */
|
testtime.tm_mon = 10; /* November, should come out as "11" */
|
||||||
testtime.tm_year = 133; /* 2033 */
|
testtime.tm_year = 133; /* 2033 */
|
||||||
|
|
||||||
res = strftime(buf, sizeof(buf), "%x", &testtime);
|
res = my_strftime(buf, sizeof(buf), "%x", &testtime);
|
||||||
|
|
||||||
setlocale(LC_TIME, save);
|
setlocale(LC_TIME, save);
|
||||||
free(save);
|
free(save);
|
||||||
|
|
Loading…
Reference in New Issue