Warning in the RecordTransactionAbort routine during compilation withO3 flag - Mailing list pgsql-bugs

From Andrey Lepikhov
Subject Warning in the RecordTransactionAbort routine during compilation withO3 flag
Date
Msg-id a7e28b83-27b1-4e1c-c76b-4268c4b785bc@postgrespro.ru
Whole thread Raw
Responses Re: Warning in the RecordTransactionAbort routine during compilationwith O3 flag  (Michael Paquier <michael@paquier.xyz>)
List 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

pgsql-bugs by date:

Previous
From: Jan Przemysław Wójcik
Date:
Subject: Unexpected extra row from jsonb_path_query() with a recursive path
Next
From: Michael Paquier
Date:
Subject: Re: Unexpected extra row from jsonb_path_query() with a recursivepath