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

Re: Re: [PATCH] Compile without warning with gcc's -Wtype-limits, -Wempty-body

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [PATCH] Compile without warning with gcc's -Wtype-limits, -Wempty-body
Date: 2013-01-16 15:11:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On 1/15/13 6:36 AM, Andres Freund wrote:
> I just think that the price of fixing a single Assert() that hasn't
> changed in years where the variable isn't likely to ever get signed is
> acceptable.

Well, once you get past that one change you proposed, you will also find

pg_standby.c: In function 'SetWALFileNameForCleanup':
pg_standby.c:348:3: error: comparison of unsigned expression >= 0 is
always true [-Werror=type-limits]

(which, curiously, is the only one that clang complains about).

I don't like removing safety checks from code when there is no other
mechanism that could make up for it somehow.

I think the best practice at the moment, as with most gcc -Wextra
warnings, is to manually check them once in a while.

In response to

pgsql-hackers by date

Next:From: Claudio FreireDate: 2013-01-16 15:23:14
Subject: Re: Parallel query execution
Previous:From: Simon RiggsDate: 2013-01-16 15:08:33
Subject: Re: log_lock_waits to identify transaction's relation

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