Skip site navigation (1) Skip section navigation (2)

Re: Further news on Clang - spurious warnings

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further news on Clang - spurious warnings
Date: 2011-08-03 08:47:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On 3 August 2011 00:52, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> Now, the only warning that remains is that same

Correction - there are actually 3 additional warnings like this in repl_gram.c:

/home/peter/build/Release/bin/clang -O2 -Wall -Wmissing-prototypes
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wformat-security -fno-strict-aliasing -fwrapv -I.
-I../../../src/include -D_GNU_SOURCE   -c -o repl_gram.o repl_gram.c
repl_gram.y:106:30: warning: implicit conversion from enumeration type
'enum ReplNodeTag' to different enumeration type 'NodeTag' (aka 'enum
NodeTag') [-Wconversion]
                                        (yyval.node) = (Node *)

../../../src/include/nodes/nodes.h:475:64: note: expanded from:
#define makeNode(_type_)                ((_type_ *)
<scratch space>:180:1: note: expanded from:
../../../src/include/nodes/nodes.h:452:19: note: expanded from:
        _result->type = (tag); \
                      ~  ^~~

I'll take a look into them later.

This tautology warning sounds completely valid:

/home/peter/build/Release/bin/clang -O2 -Wall -Wmissing-prototypes
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wformat-security -fno-strict-aliasing -fwrapv -pthread  -D_REENTRANT
-DUNSAFE_STAT_OK -I. -I../../../src/include -D_GNU_SOURCE
-I../../../src/port -I../../../src/port -DSO_MAJOR_VERSION=5  -c -o
fe-exec.o fe-exec.c
fe-exec.c:2408:13: warning: comparison of unsigned enum expression < 0
is always false [-Wtautological-compare]
        if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
            ~~~~~~ ^ ~
1 warning generated.

So, there are 4 remaining warnings.

Peter Geoghegan
PostgreSQL Development, 24x7 Support, Training and Services

In response to


pgsql-hackers by date

Next:From: Florian PflugDate: 2011-08-03 08:50:07
Subject: Re: WIP fix proposal for bug #6123
Previous:From: Alexander KorotkovDate: 2011-08-03 08:18:49
Subject: Re: WIP: Fast GiST index build

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group