Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit05c4d8f

Browse files
committed
Suppress a warning that some versions of gcc emit about %x in strftime.
Per suggestion from Alvaro.
1 parent31013db commit05c4d8f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.137 2007/05/3115:13:03 petere Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.138 2007/07/11 23:15:38 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -2155,6 +2155,13 @@ escape_quotes(const char *src)
21552155
returnresult;
21562156
}
21572157

2158+
/* Hack to suppress a warning about %x from some versions of gcc */
2159+
staticinlinesize_t
2160+
my_strftime(char*s,size_tmax,constchar*fmt,conststructtm*tm)
2161+
{
2162+
returnstrftime(s,max,fmt,tm);
2163+
}
2164+
21582165
/*
21592166
* Determine likely date order from locale
21602167
*/
@@ -2184,7 +2191,7 @@ locale_date_order(const char *locale)
21842191
testtime.tm_mon=10;/* November, should come out as "11" */
21852192
testtime.tm_year=133;/* 2033 */
21862193

2187-
res=strftime(buf,sizeof(buf),"%x",&testtime);
2194+
res=my_strftime(buf,sizeof(buf),"%x",&testtime);
21882195

21892196
setlocale(LC_TIME,save);
21902197
free(save);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp