Warning in the RecordTransactionAbort routine during compilation with O3 flag
Andrei Lepikhov <a.lepikhov@postgrespro.ru>
From: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
To: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-12-09T03:49:26Z
Lists: pgsql-bugs
Attachments
- 0001-Make-compiler-quiet.patch (text/x-patch)
Compiling of master postgres branch with CFLAGS="-O3" shows compiler
warnings:
xact.c: In function ‘RecordTransactionAbort’:
xact.c:5709:55: warning: argument 1 null where non-null expected [-Wnonnull]
XLogRegisterData(unconstify(char *, twophase_gid),
strlen(twophase_gid) + 1);
^~~~~~~~~~~~~~~~~~~~
In file included from ../../../../src/include/c.h:61:0,
from ../../../../src/include/postgres.h:46,
from xact.c:18:
/usr/include/string.h:384:15: note: in a call to function ‘strlen’
declared here
extern size_t strlen (const char *__s)
^~~~~~
formatting.c: In function ‘parse_datetime’:
formatting.c:4229:13: warning: ‘flags’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
if (flags & DCH_ZONED)
It's not a bug. But I prepare the patch to make compiler quiet.
--
Andrey Lepikhov
Postgres Professional
https://postgrespro.com
The Russian Postgres Company
Commits
-
Fix some compiler warnings with timestamp parsing in formatting.c
- c341c7d391e2 13.0 landed