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

Re: Further news on Clang - spurious warnings

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further news on Clang - spurious warnings
Date: 2011-08-03 18:15:37
Message-ID: 1312395337.24208.2.camel@vanquo.pezone.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On ons, 2011-08-03 at 10:25 +0100, Peter Geoghegan wrote:
> Attached patch removes the tautologolical part of an evaluated
> expression, fixing the problem flagged by this quite valid warning.

I think these warnings are completely bogus and should not be worked
around.  Even in the most trivial case of

{
    unsigned int foo;

    ...

    if (foo < 0 && ...)
        ...
}

I would not want to remove the check, because as the code gets moved
around, refactored, reused, whatever, the unsigned int might change into
a signed int, and then you're hosed.  It's fine for -Wextra, but not for
the -Wall level.


In response to

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2011-08-03 18:17:33
Subject: Re: Further news on Clang - spurious warnings
Previous:From: David E. WheelerDate: 2011-08-03 17:33:03
Subject: Re: Further news on Clang - spurious warnings

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