Re: Win64 warnings about size_t - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Win64 warnings about size_t
Date
Msg-id 9837222c1001011128p6b567979g1c213dee4ac33e4@mail.gmail.com
Whole thread Raw
In response to Re: Win64 warnings about size_t  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Win64 warnings about size_t  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jan 1, 2010 at 20:12, Peter Eisentraut <peter_e@gmx.net> wrote:
> On fre, 2010-01-01 at 20:01 +0100, Magnus Hagander wrote:
>>   .\src\backend\utils\mmgr\aset.c(701): warning C4334: '<<' : result
>> of 32-bit shift implicitly converted to 64 bits (was 64-bit shift
>> intended?)
>>   .\src\backend\utils\mmgr\aset.c(705): warning C4334: '<<' : result
>> of 32-bit shift implicitly converted to 64 bits (was 64-bit shift
>> intended?)
>>
>> Perhaps we need some casting there?
>
> This shouldn't be a problem for the same reason that casting size_t to
> int is not a problem in the PostgreSQL backend code, but perhaps writing
> 1L << ... would fix it.

1L didn't fix it. 1LL did, however.

ISTM that this is a warning we don't want to disable, so assuming that
should be safe on other platforms (it passes on my 32-bit linux
without warnings or anything), I'd vote for putting it in there.

-- Magnus HaganderMe: http://www.hagander.net/Work: http://www.redpill-linpro.com/


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: win32 socket definition
Next
From: Tom Lane
Date:
Subject: Re: Win64 warnings about size_t