Re: Further news on Clang - spurious warnings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Further news on Clang - spurious warnings
Date
Msg-id 6329.1312571258@sss.pgh.pa.us
Whole thread Raw
In response to Re: Further news on Clang - spurious warnings  (Peter Geoghegan <peter@2ndquadrant.com>)
Responses Re: Further news on Clang - spurious warnings
List pgsql-hackers
Peter Geoghegan <peter@2ndquadrant.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


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Further news on Clang - spurious warnings
Next
From: Robert Haas
Date:
Subject: Re: [v9.1] sepgsql - userspace access vector cache