Re: lots of unused variable warnings in assert-free builds
Peter Eisentraut <peter_e@gmx.net>
From: Peter Eisentraut <peter_e@gmx.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Andrew Dunstan <andrew@dunslane.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-03-20T18:51:59Z
Lists: pgsql-hackers
Attachments
- pg-cassert-unused-pgindent-demo.diff (text/x-patch) patch
On tis, 2012-01-24 at 13:18 -0500, Tom Lane wrote: > Robert Haas <robertmhaas@gmail.com> writes: > > Yes, that's what I meant when I suggested it originally. I'm just not > > sure it's any nicer than adding ifdefs for USE_ASSERT_CHECKING. > > I'm inclined to think that it probably is nicer, just because of less > vertical space used. But again, this opinion is contingent on what it > will look like after pgindent gets done with it ... Here is a demo diff of what pgindent would do with the various approaches (btw., nice job on making pgindent easy to use for everyone now). As you can see, pgindent adds whitespace on top of #ifdef USE_ASSERT_CHECKING, and messes up the vertical alignment of variable definitions that contain extra attributes. All things considered, I like the PG_USED_FOR_ASSERTS_ONLY solution best.