Re: fix compile warning for pg_backup_tar.c - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: fix compile warning for pg_backup_tar.c
Date
Msg-id 200411290301.iAT31tK11239@candle.pha.pa.us
Whole thread Raw
In response to Re: fix compile warning for pg_backup_tar.c  (Andrew Dunstan <andrew@dunslane.net>)
List 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@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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: fix typos in pt_br FAQ
Next
From: Bruce Momjian
Date:
Subject: Re: Updated Turkish FAQ