220 7572 <CAPBZbvyWPifS6m5utNriqer1ONQaSds0ZF38OhFyXQ_BqbkGeQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "Billy O'Neal" <billy.oneal@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Fixing the private method issue
Date: Sun, 3 Nov 2013 21:22:14 -0800
Lines: 178
Approved: news@gmane.org
Message-ID: <CAPBZbvyWPifS6m5utNriqer1ONQaSds0ZF38OhFyXQ_BqbkGeQ@mail.gmail.com>
References: <d5cd9fa5-ac2f-465b-b92d-cf2a35607245@isocpp.org>
 <2434394.qTJQO2yfY8@tjmaciei-mobl2> <CAFk2RUY1f65jz6xH8u6QbBkudp0vzqdnm4H0SfXjie+555DbMA@mail.gmail.com>
 <4608928.hBFqcpEg1D@tjmaciei-mobl2> <CAFk2RUaZr5W7L6Ez6o5xn7_Qh7gCBzEnw3=1U4=cMka7wA_D7Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e0149d0aea9c91a04ea531ba1
X-Trace: ger.gmane.org 1383542570 11737 80.91.229.3 (4 Nov 2013 05:22:50 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 4 Nov 2013 05:22:50 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDKLBLVE6ADBBLW63SJQKGQENNU4IQI@isocpp.org Mon Nov 04 06:22:57 2013
Return-path: <std-proposals+bncBDKLBLVE6ADBBLW63SJQKGQENNU4IQI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pb0-f70.google.com ([209.85.160.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDKLBLVE6ADBBLW63SJQKGQENNU4IQI@isocpp.org>)
	id 1VdCcq-0007ue-9n
	for gclcip-std-proposals@m.gmane.org; Mon, 04 Nov 2013 06:22:56 +0100
Original-Received: by mail-pb0-f70.google.com with SMTP id rp8sf11901017pbb.9
        for <gclcip-std-proposals@m.gmane.org>; Sun, 03 Nov 2013 21:22:55 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=epg9heqth5Mlz7UrAzNfyZWuop8kWIiKgAG6nUd7DzI=;
        b=jzYbSDYZWTm7mMM9CdvkMQ+fxbxMNd526RbciA4mcBqr75444n9ZaxMobqtC2BioNm
         59zpkjq73HjWssiYmPJG/XMr+5I7TgjJf9A4dhKKr+JVlmdTv+xVhsk9RV+o/NRX8JHR
         Q5mky8DcXc/MMq2P+BA659aWZKGBM9gBE7uy3DmugArRSOQNUWbhs/0wMIKMZ69p1FRo
         pecyeQo1NDlr0DwOSqIiSgogSYN3YCBNY2pkp674uGZeZGPQM4nrMdHbYnvaHDUwWrrM
         R5ZM9LM2Qc2K9svQoconjM8XDEzvoGCOOG5uTFkj9FhIFkJl5vyfh7mSNU/ZO6SG6Hre
         ol/g==
X-Gm-Message-State: ALoCoQlASuXonTelXlEmNY9oKt9IjVVDxMIC+kkiU7G4UDkz/T30nvCHk/5ZzVcFPB+jayweMMIy
X-Received: by 10.66.235.36 with SMTP id uj4mr5447574pac.9.1383542575193;
        Sun, 03 Nov 2013 21:22:55 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.118.103 with SMTP id kl7ls2135685qeb.32.gmail; Sun, 03 Nov
 2013 21:22:54 -0800 (PST)
X-Received: by 10.236.181.6 with SMTP id k6mr253821yhm.93.1383542574592;
        Sun, 03 Nov 2013 21:22:54 -0800 (PST)
Original-Received: from mail-oa0-x230.google.com (mail-oa0-x230.google.com [2607:f8b0:4003:c02::230])
        by mx.google.com with ESMTPS id 21si5117688yhf.76.2013.11.03.21.22.54
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 03 Nov 2013 21:22:54 -0800 (PST)
Received-SPF: pass (google.com: domain of billy.oneal@gmail.com designates 2607:f8b0:4003:c02::230 as permitted sender) client-ip=2607:f8b0:4003:c02::230;
Original-Received: by mail-oa0-f48.google.com with SMTP id m17so6689348oag.21
        for <std-proposals@isocpp.org>; Sun, 03 Nov 2013 21:22:54 -0800 (PST)
X-Received: by 10.60.60.105 with SMTP id g9mr12847936oer.8.1383542574138; Sun,
 03 Nov 2013 21:22:54 -0800 (PST)
Original-Received: by 10.182.87.37 with HTTP; Sun, 3 Nov 2013 21:22:14 -0800 (PST)
In-Reply-To: <CAFk2RUaZr5W7L6Ez6o5xn7_Qh7gCBzEnw3=1U4=cMka7wA_D7Q@mail.gmail.com>
X-Original-Sender: billy.oneal@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of billy.oneal@gmail.com designates 2607:f8b0:4003:c02::230 as
 permitted sender) smtp.mail=billy.oneal@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:7572
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7572>

--089e0149d0aea9c91a04ea531ba1
Content-Type: text/plain; charset=ISO-8859-1

It is overridden in one translation unit, but not in another translation
unit. That means the vtbl in each translation unit differs, which leads to
ODR violations. (This is assuming virtual functions are implemented in
terms of vtbls, but all implementations of which I am aware implement
things that way)

Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com


On Sun, Nov 3, 2013 at 8:41 PM, Ville Voutilainen <
ville.voutilainen@gmail.com> wrote:

>
>
>
> On 4 November 2013 06:15, Thiago Macieira <thiago@macieira.org> wrote:
>
>> On segunda-feira, 4 de novembro de 2013 06:02:39, Ville Voutilainen wrote:
>> > They cannot? As in, virtual functions cannot be overridden? Are you
>> thinking
>> > about final here?
>> >
>> >
>> > > Overriding a virtual function may change the ABI. *Any* virtual
>> > > declaration
>> > > must be visible to all callers.
>>
>> > Same question, I guess.
>>
>> Ok, after rereading what I posted, looks like I might not have answered
>> the
>> right post. So let me start over:
>>
>> This thread is about adding methods to a class without having it in the
>> main
>> class { } body, which is visible to all users. I support that idea.
>>
>> However, that must be entirely restricted to non-virtual methods.
>>
>> Adding a virtual method, like everyone who has done any binary
>> compatibility
>> work knows, is not possible. That includes overrides. Any and all virtual
>> methods present in a given class -- whether new or overrides -- must be
>> declared in the class body and visible to all users.
>>
>>
>>
> I still have trouble grokking the "that includes overrides" part. How does
> adding
> an override change the ABI?
>
>  --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--089e0149d0aea9c91a04ea531ba1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">It is overridden in one translation unit, but not in anoth=
er translation unit. That means the vtbl in each translation unit differs, =
which leads to ODR violations. (This is assuming virtual functions are impl=
emented in terms of vtbls, but all implementations of which I am aware impl=
ement things that way)</div>

<div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><div>Bil=
ly O&#39;Neal</div><div><a href=3D"https://bitbucket.org/BillyONeal/" targe=
t=3D"_blank">https://github.com/BillyONeal/</a></div><div><a href=3D"http:/=
/stackoverflow.com/users/82320/billy-oneal" target=3D"_blank">http://stacko=
verflow.com/users/82320/billy-oneal</a></div>

<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Sun, Nov 3, 2013 at 8:41 PM, Ville Vo=
utilainen <span dir=3D"ltr">&lt;<a href=3D"mailto:ville.voutilainen@gmail.c=
om" target=3D"_blank">ville.voutilainen@gmail.com</a>&gt;</span> wrote:<br>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote"><div class=3D"im">On 4 November 2013 06:15, Thiago Macieira <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:thiago@macieira.org" target=3D"_blank">thi=
ago@macieira.org</a>&gt;</span> wrote:<br>


<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div>On segunda-feira, 4 de novembro de 2013 06:02:39, Vil=
le Voutilainen wrote:<br>


&gt; They cannot? As in, virtual functions cannot be overridden? Are you th=
inking<br>
&gt; about final here?<br>
&gt;<br>
&gt;<br>
&gt; &gt; Overriding a virtual function may change the ABI. *Any* virtual<b=
r>
&gt; &gt; declaration<br>
&gt; &gt; must be visible to all callers.<br>
<br>
&gt; Same question, I guess.<br>
<br>
</div>Ok, after rereading what I posted, looks like I might not have answer=
ed the<br>
right post. So let me start over:<br>
<br>
This thread is about adding methods to a class without having it in the mai=
n<br>
class { } body, which is visible to all users. I support that idea.<br>
<br>
However, that must be entirely restricted to non-virtual methods.<br>
<br>
Adding a virtual method, like everyone who has done any binary compatibilit=
y<br>
work knows, is not possible. That includes overrides. Any and all virtual<b=
r>
methods present in a given class -- whether new or overrides -- must be<br>
declared in the class body and visible to all users.<br>
<div><div><br><br></div></div></blockquote><div><br></div></div><div>I stil=
l have trouble grokking the &quot;that includes overrides&quot; part. How d=
oes adding<br>an override change the ABI? <br></div>
</div><br></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=A0<br>
--- <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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0149d0aea9c91a04ea531ba1--

.
