mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
Clean up compiler warnings from unused variables with asserts disabled
For those variables only used when asserts are enabled, use a new macro PG_USED_FOR_ASSERTS_ONLY, which expands to __attribute__((unused)) when asserts are not enabled.
This commit is contained in:
@@ -685,7 +685,7 @@ LruInsert(File file)
|
||||
/* seek to the right position */
|
||||
if (vfdP->seekPos != (off_t) 0)
|
||||
{
|
||||
off_t returnValue;
|
||||
off_t returnValue PG_USED_FOR_ASSERTS_ONLY;
|
||||
|
||||
returnValue = lseek(vfdP->fd, vfdP->seekPos, SEEK_SET);
|
||||
Assert(returnValue != (off_t) -1);
|
||||
|
||||
@@ -2013,7 +2013,7 @@ RestoreScratchTarget(bool lockheld)
|
||||
static void
|
||||
RemoveTargetIfNoLongerUsed(PREDICATELOCKTARGET *target, uint32 targettaghash)
|
||||
{
|
||||
PREDICATELOCKTARGET *rmtarget;
|
||||
PREDICATELOCKTARGET *rmtarget PG_USED_FOR_ASSERTS_ONLY;
|
||||
|
||||
Assert(LWLockHeldByMe(SerializablePredicateLockListLock));
|
||||
|
||||
@@ -2074,7 +2074,7 @@ DeleteChildTargetLocks(const PREDICATELOCKTARGETTAG *newtargettag)
|
||||
{
|
||||
uint32 oldtargettaghash;
|
||||
LWLockId partitionLock;
|
||||
PREDICATELOCK *rmpredlock;
|
||||
PREDICATELOCK *rmpredlock PG_USED_FOR_ASSERTS_ONLY;
|
||||
|
||||
oldtargettaghash = PredicateLockTargetTagHashCode(&oldtargettag);
|
||||
partitionLock = PredicateLockHashPartitionLock(oldtargettaghash);
|
||||
@@ -2227,7 +2227,7 @@ DecrementParentLocks(const PREDICATELOCKTARGETTAG *targettag)
|
||||
{
|
||||
uint32 targettaghash;
|
||||
LOCALPREDICATELOCK *parentlock,
|
||||
*rmlock;
|
||||
*rmlock PG_USED_FOR_ASSERTS_ONLY;
|
||||
|
||||
parenttag = nexttag;
|
||||
targettaghash = PredicateLockTargetTagHashCode(&parenttag);
|
||||
|
||||
@@ -808,7 +808,7 @@ static void
|
||||
AuxiliaryProcKill(int code, Datum arg)
|
||||
{
|
||||
int proctype = DatumGetInt32(arg);
|
||||
PGPROC *auxproc;
|
||||
PGPROC *auxproc PG_USED_FOR_ASSERTS_ONLY;
|
||||
|
||||
Assert(proctype >= 0 && proctype < NUM_AUXILIARY_PROCS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user