From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11676 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: Documentation of memcpy and undefined behavior in memset Date: Thu, 6 Jul 2017 18:52:52 +0300 (MSK) Message-ID: References: <0F9B48AD-C5B3-44B6-8D82-0985CF8604A0@trust-in-soft.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1499356395 1763 195.159.176.226 (6 Jul 2017 15:53:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2017 15:53:15 +0000 (UTC) User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) To: "musl@lists.openwall.com" Original-X-From: musl-return-11689-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jul 06 17:53:11 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dT95Z-0000Bh-5g for gllmg-musl@m.gmane.org; Thu, 06 Jul 2017 17:53:09 +0200 Original-Received: (qmail 12247 invoked by uid 550); 6 Jul 2017 15:53:09 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 12226 invoked from network); 6 Jul 2017 15:53:09 -0000 In-Reply-To: <0F9B48AD-C5B3-44B6-8D82-0985CF8604A0@trust-in-soft.com> Xref: news.gmane.org gmane.linux.lib.musl.general:11676 Archived-At: On Thu, 6 Jul 2017, Pascal Cuoq wrote: > It can be argued that C11 does not define the behavior of memcpy in this case: > https://stackoverflow.com/questions/25390577/is-memcpya-1-b-1-0-defined-in-c11 Is the main issue that there are doubts whether pointers one-past may be "outside the address space of the program"? To me it's pretty clear that while the standard doesn't appear to formally define the "address space", the intent is that pointers one-past would be a part of it for. There are indications in 6.5.8/5 ("When two pointers are compared, the result depends on the relative locations in the address space of the objects pointed to...") and footnote 106 to 6.5.6 in C11. Alexander