Thread: unused variable

unused variable

From
Gaetano Mendola
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I'm compiling the last postgres CVS version and I get:

vacuum.c: In function `repair_frag':
vacuum.c:1528: warning: unused variable `myXID'



Regards
Gaetano Mendola




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA+bCj7UpzwH2SGd4RAtyKAJsH6V22SijBN3VD/HJ/sWoLO8Ta7wCcD1wt
U2VsEehBuK64q4/kjsHA4g4=
=TsL8
-----END PGP SIGNATURE-----



Re: unused variable

From
Bruce Momjian
Date:
OK, it turns out myXID is only used by Assert tests, and most developers
compile with Asserts.  I have fixed this by defining the variable only
when asserts are enabled.

Patch attached and applied.

---------------------------------------------------------------------------

Gaetano Mendola wrote:
[ PGP not available, raw data follows ]
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> I'm compiling the last postgres CVS version and I get:
>
> vacuum.c: In function `repair_frag':
> vacuum.c:1528: warning: unused variable `myXID'
>
>
>
> Regards
> Gaetano Mendola
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFA+bCj7UpzwH2SGd4RAtyKAJsH6V22SijBN3VD/HJ/sWoLO8Ta7wCcD1wt
> U2VsEehBuK64q4/kjsHA4g4=
> =TsL8
> -----END PGP SIGNATURE-----
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>
[ End of raw data]

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/commands/vacuum.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/commands/vacuum.c,v
retrieving revision 1.282
diff -c -c -r1.282 vacuum.c
*** src/backend/commands/vacuum.c    1 Jul 2004 00:50:11 -0000    1.282
--- src/backend/commands/vacuum.c    20 Jul 2004 22:43:52 -0000
***************
*** 1525,1531 ****
--- 1525,1533 ----
              VacPageList vacuum_pages, VacPageList fraged_pages,
              int nindexes, Relation *Irel)
  {
+ #ifdef    USE_ASSERT_CHECKING
      TransactionId myXID = GetCurrentTransactionId();
+ #endif
      Buffer        dst_buffer = InvalidBuffer;
      BlockNumber nblocks,
                  blkno;