Re: OSX doesn't accept identical source/target for strcpy() anymore

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Matthias Schmitt <freak002(at)mmp(dot)lu>
Subject: Re: OSX doesn't accept identical source/target for strcpy() anymore
Date: 2013-10-28 20:11:19
Message-ID: CAM3SWZTBtqdSAAVGJUhp2en4yf6R+E1sG_YvfXPCq6nzqk9ZEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, Oct 28, 2013 at 6:11 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Both gcc and glibc have been moving steadily in the direction of
> aggressively exploiting "undefined behavior" cases for optimization
> purposes. I don't know if there is yet a platform where strncpy with
> src == dest behaves oddly, but we'd be foolish to imagine that it's
> not going to happen eventually. If anything, Apple is probably doing
> us a service by making it obvious where we're failing to adhere to spec.

It's worth being aware of the fact that the upcoming GCC 4.9 release
is expected to ship with an "Undefined Behavior Sanitizer", as
described here:

http://gcc.gnu.org/gcc-4.9/changes.html

--
Peter Geoghegan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2013-10-28 20:32:53 Re: OSX doesn't accept identical source/target for strcpy() anymore
Previous Message Tom Lane 2013-10-28 20:02:36 Re: OSX doesn't accept identical source/target for strcpy() anymore

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-10-28 20:14:47 Re: Detection of nested function calls
Previous Message Tom Lane 2013-10-28 20:06:47 Re: better atomics