Re: fix memcpy() overlap

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: fix memcpy() overlap
Дата
Msg-id 401ECCA0.2000809@dunslane.net
обсуждение исходный текст
Ответ на Re: fix memcpy() overlap  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-patches

Stephan Szabo wrote:

>On Mon, 2 Feb 2004, Tom Lane wrote:
>
>
>
>>Neil Conway <neilc@samurai.com> writes:
>>
>>
>>>I don't know of a memcpy() implementation that would actually bail out
>>>if called with two equal pointers, but perhaps there is one in
>>>existence somewhere.
>>>
>>>
>>This isn't a bug, and I see no reason to clutter the code just to shut
>>up valgrind.
>>
>>
>
>Isn't memcpy on overlapping (even entirely overlapping) buffers undefined
>behavior unless the count is 0?
>
>
>

On my Linux box the man page says:

DESCRIPTION
       The  memcpy()  function  copies  n bytes from memory area src to
memory
       area dest.  The memory areas may not overlap.  Use  memmove(3)
if  the
       memory areas do overlap.

cheers

andrew


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

Предыдущее
От: Michael van Elst
Дата:
Сообщение: Re: fix memcpy() overlap
Следующее
От: Claudio Natoli
Дата:
Сообщение: Re: [pgsql-hackers-win32] Proposed dirmod.c fix for Win