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, modulenam
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
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 m
Peter Eisentraut wrote:
Andrew Dunstan wrote:
Yet another fix for a useless compile warning. This one is slightly
ugly ;-(
First of all, ugly code needs to be documented in the code.
Ok. Perhaps code that is expected to generate warnings should be too ;-)
Then, the diff
+ #ifdef INT64_I
Andrew Dunstan wrote:
> Yet another fix for a useless compile warning. This one is slightly
> ugly ;-(
First of all, ugly code needs to be documented in the code.
Then, the diff
+ #ifdef INT64_IS_BUSTED
if (th->fileLen > MAX_TAR_MEMBER_FILELEN)
+ #else
+ if (((int64) th->fileLen -1
Andrew Dunstan <[EMAIL PROTECTED]> writes:
> Yet another fix for a useless compile warning. This one is slightly ugly ;-(
Why not use off_t in the first place?
regards, tom lane
---(end of broadcast)---
TIP 7: don't forget t
Yet another fix for a useless compile warning. This one is slightly ugly ;-(
cheers
andrew
Index: src/bin/pg_dump/pg_backup_tar.c
===
RCS file: /home/cvsmirror/pgsql/src/bin/pg_dump/pg_backup_tar.c,v
retrieving revision 1.45
diff -c -