gcc 4.6 warnings -Wunused-but-set-variable

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: gcc 4.6 warnings -Wunused-but-set-variable
Date: 2011-03-29 20:48:49
Message-ID: 1301431729.22050.7.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

As you might have heard, GCC 4.6 was released the other day. It
generates a bunch of new warnings with the PostgreSQL source code, most
of which belong to the new warning scenario -Wunused-but-set-variable,
which is included in -Wall.

Attached is a patch that gets rid of most of these. As you can see,
most of these remove real leftover garbage. The line I marked in
pg_basebackup.c might be an actual problem: It goes through a whole lot
to figure out the timeline and then doesn't do anything with it. In
some other cases, however, one might argue that the changes lose some
clarity, such as when dropping the return value of strtoul() or
va_arg(). How should we proceed? In any case, my patch should be
re-reviewed for any possible side effects that I might have hastily
removed.

Attachment Content-Type Size
unused-but-set-variable.patch text/x-patch 42.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2011-03-29 21:34:16 Process local hint bit cache
Previous Message Christopher Browne 2011-03-29 20:10:39 Re: Additional options for Sync Replication