lots of unused variable warnings in assert-free builds

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-01-14T21:53:18Z
Lists: pgsql-hackers

Attachments

In builds without --enable-cassert (I guess not many developers use
those a lot), there are quite a few unused variable warnings.  These
usually hold some intermediate result that the assert checks later.  I
see that in some places our code already uses #ifdef
USE_ASSERT_CHECKING, presumably to hide similar issues.  But in most
cases using this would significantly butcher the code.  I found that
adding __attribute__((unused)) is cleaner.  Attached is a patch that
cleans up all the warnings I encountered.