Re: Further news on Clang - spurious warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further news on Clang - spurious warnings
Date: 2011-08-05 19:07:38
Message-ID: 6329.1312571258@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Geoghegan <peter(at)2ndquadrant(dot)com> writes:
> Now, apart from the Flex warning, there are just 3 warnings left. They
> all look like this:

> repl_gram.y:106:30: warning: implicit conversion from enumeration type
> 'enum ReplNodeTag' to different enumeration type 'NodeTag' (aka 'enum
> NodeTag') [-Wconversion]

> Attached patch fixes all 3 warnings with an explicit cast,

This patch is a truly horrid idea, as it eliminates the error checking
the compiler is trying to provide, and does so globally not only in the
trouble spots.

If I were trying to get rid of this warning, I'd be wondering why
ReplNodeTag is a distinct enum in the first place. Surely it does not
make sense to be using the Node mechanisms on something that isn't
conforming to the standard node numbering. If these nodes ever got
passed to anything else in the system, they'd get misinterpreted.
So I'm inclined to think that clang has pointed out a real issue,
rather than something we ought to paper over.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-08-05 20:26:30 Re: [v9.1] sepgsql - userspace access vector cache
Previous Message Peter Geoghegan 2011-08-05 18:52:32 Re: Further news on Clang - spurious warnings