Re: Further news on Clang - spurious warnings

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Further news on Clang - spurious warnings
Дата
Msg-id CAEYLb_V1XcYbiOQn7GdAgTUMbBb6T4w0ksdFmTA+NUKDTbJW5Q@mail.gmail.com
обсуждение исходный текст
Ответ на Further news on Clang - spurious warnings  (Peter Geoghegan <peter@2ndquadrant.com>)
Ответы Re: Further news on Clang - spurious warnings  (Peter Geoghegan <peter@2ndquadrant.com>)
Re: Further news on Clang - spurious warnings  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
On 3 August 2011 00:52, Peter Geoghegan <peter@2ndquadrant.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 *)
makeNode(IdentifySystemCmd);

^~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/include/nodes/nodes.h:475:64: note: expanded from:
#define makeNode(_type_)                ((_type_ *)
newNode(sizeof(_type_),T_##_type_))                                                                            ^
<scratch space>:180:1: note: expanded from:
T_IdentifySystemCmd
^
../../../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
-D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic -DFRONTEND
-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       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: WIP: Fast GiST index build
Следующее
От: Florian Pflug
Дата:
Сообщение: Re: WIP fix proposal for bug #6123