Re: fix memcpy() overlap - Mailing list pgsql-patches

From Michael van Elst
Subject Re: fix memcpy() overlap
Date
Msg-id 20040202221949.GA24798@serpens.de
Whole thread Raw
In response to Re: fix memcpy() overlap  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-patches
On Mon, Feb 02, 2004 at 01:23:15PM -0800, Stephan Szabo wrote:
>
> Isn't memcpy on overlapping (even entirely overlapping) buffers undefined
> behavior unless the count is 0?

The C standard says: "If copying takes place between objects that overlap,
the behaviour is undefined". SUSv3 says the same.

To my understanding this also includes copying something onto itself.

--
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."

pgsql-patches by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: [pgsql-hackers-win32] Win32 signals patch #2
Next
From: Andrew Dunstan
Date:
Subject: Re: fix memcpy() overlap