220 30400 <b7eda119-bc5d-4940-b359-45088e6f4d3e@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Chris Hallock <christopherhallock@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: P0298: A byte type definition: with undefined
 pointer arithmetic?
Date: Sat, 7 Jan 2017 11:52:21 -0800 (PST)
Lines: 71
Approved: news@gmane.org
Message-ID: <b7eda119-bc5d-4940-b359-45088e6f4d3e@isocpp.org>
References: <e21a1901-1ed5-5795-6244-dd70c4d08adf@f2.dion.ne.jp>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1912_1678509821.1483818741705"
X-Trace: blaine.gmane.org 1483818751 20877 195.159.176.226 (7 Jan 2017 19:52:31 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 7 Jan 2017 19:52:31 +0000 (UTC)
Cc: neilmac@microsoft.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCHINCHEQEFBB5UNYXBQKGQEE5JAOEQ@isocpp.org Sat Jan 07 20:52:26 2017
Return-path: <std-proposals+bncBCHINCHEQEFBB5UNYXBQKGQEE5JAOEQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f72.google.com ([74.125.83.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCHINCHEQEFBB5UNYXBQKGQEE5JAOEQ@isocpp.org>)
	id 1cPx2J-0004Hb-1Z
	for gclcip-std-proposals@m.gmane.org; Sat, 07 Jan 2017 20:52:19 +0100
Original-Received: by mail-pg0-f72.google.com with SMTP id 5sf1651099872pgi.2
        for <gclcip-std-proposals@m.gmane.org>; Sat, 07 Jan 2017 11:52:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=wpSOVh4p/PMwG3G8VyROrEM+LJ//fXykbf/UdVtXnFo=;
        b=KlKh1h7f2S4WE94vCD2eyapLQnjudGYUE5lxEmW39bpW+k3BWJjHL50OFkOE/LkmyU
         e8n8+KzVkH8dhu2tmIpuStgr8YvSCQ6jVYK6RW6RNFj+//6NuXfdUYyIW2ZYHJdFTpM+
         9spMqGc9rm4vnjFyHSOT+A1HOedBvDmu8Wh1tKa070XEMHfE81kLvXCm7dMCz1ZxDAM0
         chaxKPaVRZU1Cp11z5u5JPOBufCpSzLy7IS0t2dLFiazS2v6eElOgRYBnZn4KkcAGrxb
         Nnn0ZubD9mG7IQvjk+Omn9t7FDlpBsOD8PQTthfnW265K+Draljw/7nwf0zoFgKBp/I6
         NljA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=wpSOVh4p/PMwG3G8VyROrEM+LJ//fXykbf/UdVtXnFo=;
        b=DuwRjQkyMv9bHk2rzMuNlTt0VVjSiyfoFM24O87PKijVBrgoD0Sw1JVwcu+XWszWBk
         Vp0xCckqp/qmBjZcDruV4nHF8y2DRl1anviRGOpMn+shIRiCBgW7w+ehyQQMRtY1El2j
         /gVwtiZJ03/F/UOJeWoyZxNmvQa16xZb8J1Xp690WJsvBHvrfzXGTIIvHda+KlPN0p1S
         2uMoypmqMFiMHhVYWVWIZbJuz36eyiTJANgaYFmvBpuFZXpSmaXFweHdzChjtZ5ViI6a
         zC/t1iGoapIS1QMoqS3CqyiCSo5xFBaJY8JUPYS9pKpcdsuVQvA4DgS4K3uYepMHslCB
         kNFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=wpSOVh4p/PMwG3G8VyROrEM+LJ//fXykbf/UdVtXnFo=;
        b=LBKmitcCiekJ36EsusO4C9Z9VCX28H1pwxWUFYWPUH8D/q4yM4kGGRUHKVo6nYyWup
         yeqsOGJpSUmEU78A19uX/elTikDo37rFIrnjETISrZr3HFETn0iiRjHI3XObIVWCeS3C
         3+mKEXxvSrg/2ZLJRv1HXd6QpGGckOqcUzZcVXVQZC4KrIWqoz/Vz5ui9qVXYIZMOf6R
         i9g7R+csCoTDGMd3JtoxHPlJCxVMhWFmo24p2TfUC1ePYEyhA93xl2dGr+t/uE2Io2vL
         I7hgk3HiW2b4Fhtp9mM4r7MnGdo/ZGn1sidsOTLDZZT77UxWZpXO2moOGV/RWeEMW9sJ
         FPrA==
X-Gm-Message-State: AIkVDXLMSb1jVf6N3HGlsU31c7w6P1IYSDiDBSKlEC/miiWn2gdCEtJdLa18OXrePK0Htg==
X-Received: by 10.99.115.21 with SMTP id o21mr40495300pgc.149.1483818742936;
        Sat, 07 Jan 2017 11:52:22 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.27.137 with SMTP id z9ls4188937otd.28.gmail; Sat, 07 Jan
 2017 11:52:22 -0800 (PST)
X-Received: by 10.157.35.89 with SMTP id k25mr607382otd.11.1483818742182;
        Sat, 07 Jan 2017 11:52:22 -0800 (PST)
In-Reply-To: <e21a1901-1ed5-5795-6244-dd70c4d08adf@f2.dion.ne.jp>
X-Original-Sender: christopherhallock@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:30400
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30400>

------=_Part_1912_1678509821.1483818741705
Content-Type: multipart/alternative; 
	boundary="----=_Part_1913_1414418781.1483818741705"

------=_Part_1913_1414418781.1483818741705
Content-Type: text/plain; charset=UTF-8

On Wednesday, January 4, 2017 at 2:43:24 AM UTC-8, Kazutoshi SATODA wrote:

> [...] AFAIK, the current standard doesn't (or fails to) give 
> well-defined behavior to such byte-oriented access on objects of 
> arbitrary types. [...]
>

I, for one, would be shocked if the Committee (or anyone, really) actually 
wants byte-oriented pointer arithmetic within objects to be undefined. I 
strongly anticipate that CWG will accept issue 1701 as a defect and make it 
well-defined. Remember, we're not really talking about the byte accesses 
themselves; such aliasing is already well-defined for char and unsigned char. 
It is only the charPtr + i (or charPtr[i]) expression that is currently 
undefined, and that expression can be awkwardly worked around anyway on 
some platforms (e.g., cast to integer, add, cast back to pointer).

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/b7eda119-bc5d-4940-b359-45088e6f4d3e%40isocpp.org.

------=_Part_1913_1414418781.1483818741705
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, January 4, 2017 at 2:43:24 AM UTC-8, Kazutos=
hi SATODA wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">[...] AFAI=
K, the current standard doesn&#39;t (or fails to) give
<br>well-defined behavior to such byte-oriented access on objects of
<br>arbitrary types. [...]<br></blockquote><div><br>I, for one, would be sh=
ocked if the Committee (or anyone, really) actually wants byte-oriented poi=
nter arithmetic within objects to be undefined. I strongly anticipate that =
CWG will accept issue 1701 as a defect and make it well-defined. Remember, =
we&#39;re not really talking about the byte accesses themselves; such alias=
ing is already well-defined for <span style=3D"font-family: courier new,mon=
ospace;">char</span> and <span style=3D"font-family: courier new,monospace;=
">unsigned char</span>. It is only the <span style=3D"font-family: courier =
new,monospace;">charPtr + i</span> (or <span style=3D"font-family: courier =
new,monospace;">charPtr[i]</span>) expression that is currently undefined, =
and that expression can be awkwardly worked around anyway on some platforms=
 (e.g., cast to integer, add, cast back to pointer).<br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/b7eda119-bc5d-4940-b359-45088e6f4d3e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b7eda119-bc5d-4940-b359-45088e6f4d3e=
%40isocpp.org</a>.<br />

------=_Part_1913_1414418781.1483818741705--

------=_Part_1912_1678509821.1483818741705--

.
