Thread

  1. Re: Further news on Clang - spurious warnings

    Peter Geoghegan <peter@2ndquadrant.com> — 2011-08-06T12:45:01Z

    On 5 August 2011 20:07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
    > 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.
    
    I think that the mistake I may have made here was assuming that the
    existing code was perfect, and therefore it was a simply matter of
    tweaking. With that assumption in mind, the only fix could have been a
    global fix. I should not have acted in haste.
    
    > If I were trying to get rid of this warning, I'd be wondering why
    > ReplNodeTag is a distinct enum in the first place.
    
    Indeed, that doesn't seem to be justified anywhere, and seems to be a
    violation of the abstraction of Node as a pseudo base class which
    would have broken any "downcasting" that we might have attempted to
    do. Since ReplNodeTag wasn't being used directly, just its enumeration
    constants, simply moving the constants to the global, generic NodeTag
    enum fixes the issue.
    
    That is what the attached patch does.
    
    -- 
    Peter Geoghegan       http://www.2ndQuadrant.com/
    PostgreSQL Development, 24x7 Support, Training and Services