Warning in the RecordTransactionAbort routine during compilation with O3 flag

From: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Warning in the RecordTransactionAbort routine during compilation with O3 flag
Date: 2019-12-09 03:49:26
Message-ID: a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Attachment Content-Type Size
0001-Make-compiler-quiet.patch text/x-patch 2.6 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2019-12-09 07:28:56 Re: Unexpected extra row from jsonb_path_query() with a recursive path
Previous Message Jan Przemysław Wójcik 2019-12-08 11:43:18 Unexpected extra row from jsonb_path_query() with a recursive path