Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170706181326.GF1627@brightrain.aerifal.cx>
Date: Thu, 6 Jul 2017 14:13:26 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Documentation of memcpy and undefined behavior in memset

On Thu, Jul 06, 2017 at 08:38:29PM +0300, Alexander Monakov wrote:
> On Thu, 6 Jul 2017, Rich Felker wrote:
> 
> > I'm doubtful of this. Certainly passing a pointer to memcpy with a
> > nonzero n is a guarantee that the pointed-to object is non-volatile.
> > The n=0 case is less clear though.
> 
> My view is that since in n=0 case no memory access inside of memcpy
> takes place, the compiler may not deduce that the pointed-to object is
> ok for speculative reads.

Indeed, I think that's a valid interpretation, but not the only one;
the problem here is that the specification is ambiguous, and I suspect
nobody wants to fix the ambiguity because they know they're going to
have an argument over what it was intended to mean...

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.