pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
To: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Warning in the RecordTransactionAbort routine during compilation with O3 flag
Date: Mon, 9 Dec 2019 08:49:26 +0500
Message-ID: <a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru> (raw)

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

Attachments:

  0001-Make-compiler-quiet.patch (text/x-patch, 0B) download

view thread (6+ messages)  latest in thread

Message-ID: <a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru>
Permalink:  ../a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru/
Also on:    postgresql.org/message-id/a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: a.lepikhov@postgrespro.ru
  Subject: Re: Warning in the RecordTransactionAbort routine during compilation with O3 flag
  In-Reply-To: <a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru>
  References: <a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox