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
Neil Conway <[EMAIL PROTECTED]> writes:
> This patch fixes a trivial compiler warning introduced recently in
> bufmgr.c
Done.
regards, tom lane
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send a
Patch applied. Thanks.
---
Neil Conway wrote:
> I get the following warning when I compile src/bin/pg_id/pg_id.c:
>
> gcc -pipe -g -Wall -Wmissing-prototypes -Wmissing-declarations
> -I../../../src/include -c -o pg_id.
Your patch has been added to the PostgreSQL unapplied patches list at:
http://momjian.postgresql.org/cgi-bin/pgpatches
I will try to apply it within the next 48 hours.
---
Neil Conway wrote:
> I get the following