Re: fix compile warning for pg_backup_tar.c

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix compile warning for pg_backup_tar.c
Date: 2004-11-29 03:01:55
Message-ID: 200411290301.iAT31tK11239@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


I have added a comment explaining the possible compiler warning:

/*
* Some compilers with throw a warning knowing this test can never be
* true because off_t can't exceed the compared maximum.
*/
if (th->fileLen > MAX_TAR_MEMBER_FILELEN)
die_horribly(AH, modulename, "archive member too large for tar format\n");

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

Andrew Dunstan wrote:
>
>
> Peter Eisentraut wrote:
>
> >Andrew Dunstan wrote:
> >
> >
> >>ISTM that what is happening here is that the compiler is smart enough
> >>to know that what is in MAX_TAR_MEMBER_FILELEN can't be exceeded by
> >>any possible value of type off_t.
> >>
> >>
> >
> >Yeah, I think off_t is only 32 bits there. Then using INT64_IS_BUSTED
> >as conditional is really misleading.\
> >
> >
>
> What would you like me to use? Or maybe we should just do this in all
> cases instead of using an ifdef?
>
> cheers
>
> andrew
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-11-29 03:04:12 Re: Updated Turkish FAQ
Previous Message Serguei Mokhov 2004-11-29 02:04:17 Translation updates for 8.0: pg_config-ru, initdb-ru, pg_ctl-ru, pg_dump-ru, psql-ru