lots of unused variable warnings in assert-free builds

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: lots of unused variable warnings in assert-free builds
Date: 2012-01-14 21:53:18
Message-ID: 1326577998.31492.19.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
pg-cassert-unused.patch text/x-patch 7.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-01-14 22:18:51 Re: separate initdb -A options for local and host
Previous Message Dimitri Fontaine 2012-01-14 21:46:18 Re: Command Triggers