Re: Win64 warnings about size_t

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Win64 warnings about size_t
Дата
Msg-id 2406.1262368069@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Win64 warnings about size_t  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: Win64 warnings about size_t  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> 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.

Yeah.  Getting rid of all those cases is impractical I think, and
pointless anyway --- we have limitations in palloc and Datum
representation that ensure we'll never be dealing with strings (or other
values) larger than 1GB.

> strlen() returns size_t, which AFAICS is per the standard and not even
> a Microsoft-specific idea.

Correct.

> So I don't really see what win64 does differently in this case, but
> perhaps I've been looking at this code too long? Or is it simply that
> MSVC warns about this and GCC doesn't, and I shuld disbale the
> warning?

I think MSVC is just complaining about something gcc doesn't.  If you
can disable this specific warning it'd be a good plan.
        regards, tom lane


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Cancelling idle in transaction state
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Win64 warnings about size_t