Re: Win64 warnings about size_t

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Win64 warnings about size_t
Дата
Msg-id 201001021606.o02G6Dq02295@momjian.us
обсуждение исходный текст
Ответ на Re: Win64 warnings about size_t  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Magnus Hagander wrote:
> On Sat, Jan 2, 2010 at 03:13, Bruce Momjian <bruce@momjian.us> wrote:
> > Magnus Hagander wrote:
> >> I have adapted the win64 patches a bit, and now have a working build.
> >> As in it runs the regression tests fine. However, I have well over a
> >> thousand warnings of the type:
> >> conversion from 'size_t' to 'int', possible loss of data
> >>
> >> My first 5-6 checks of where these happen are all cases where we
> >> assign the result of strlen() something to an int, or call a function
> >> taking an int as parameter with the result of strlen() in there.
> >>
> >> strlen() returns size_t, which AFAICS is per the standard and not even
> >> a Microsoft-specific idea. size_t is 8-bit - but it appears to be
> >> 8-bit on Linux as well, when in 64-bit mode.
> >
> > Uh, you mean size_t is 8 _bytes_ on Win64? ?That would make sense.
> 
> Yes, 8 bytes, 64 bit. Of course :-) Sorry.

If we are storing potentially 64-bit values in 32-bit variables and we
know the value is going to fit, it would be nice if we could document
this some way, perhaps with some typedef data type.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ssize_t vs win64
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: quoting psql varible as identifier