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

Commit235c0f6

Browse files
committed
Fix compiler warning induced by commitd8b15ee.
I forgot that INT64_FORMAT can't be used with sscanf on Windows.Use the same trick of sscanf'ing into a temp variable as we do insome other places in zic.c.The upstream IANA code avoids the portability problem by relying on<inttypes.h>'s SCNdFAST64 macro. Once we're requiring C99 in allbranches, we should do likewise and drop this set of diffs fromupstream. For now, though, a hack seems fine, since we do notactually care about leapseconds anyway.Discussion:https://postgr.es/m/4e5d1a5b-143e-e70e-a99d-a3b01c1ae7c3@2ndquadrant.com
1 parentb8fd4e0 commit235c0f6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎src/timezone/zic.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,20 @@ infile(const char *name)
12921292
if (nfields==0)
12931293
{
12941294
if (name==leapsec&&*buf=='#')
1295-
sscanf(buf,"#expires "INT64_FORMAT,&comment_leapexpires);
1295+
{
1296+
/*
1297+
* PG: INT64_FORMAT isn't portable for sscanf, so be content
1298+
* with scanning a "long". Once we are requiring C99 in all
1299+
* live branches, it'd be sensible to adopt upstream's
1300+
* practice of using the <inttypes.h> macros. But for now, we
1301+
* don't actually use this code, and it won't overflow before
1302+
* 2038 anyway.
1303+
*/
1304+
longcl_tmp;
1305+
1306+
sscanf(buf,"#expires %ld",&cl_tmp);
1307+
comment_leapexpires=cl_tmp;
1308+
}
12961309
}
12971310
elseif (wantcont)
12981311
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp