From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6606 invoked by alias); 3 Nov 2015 23:50:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 6579 invoked by uid 89); 3 Nov 2015 23:50:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-qg0-f49.google.com Received: from mail-qg0-f49.google.com (HELO mail-qg0-f49.google.com) (209.85.192.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 03 Nov 2015 23:50:08 +0000 Received: by qgeo38 with SMTP id o38so28176532qge.0; Tue, 03 Nov 2015 15:50:06 -0800 (PST) X-Received: by 10.140.28.11 with SMTP id 11mr40957477qgy.94.1446594606084; Tue, 03 Nov 2015 15:50:06 -0800 (PST) Received: from [192.168.0.26] (97-124-162-152.hlrn.qwest.net. [97.124.162.152]) by smtp.gmail.com with ESMTPSA id s75sm6991731qhb.33.2015.11.03.15.50.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 15:50:05 -0800 (PST) Message-ID: <5639482B.1050309@gmail.com> Date: Tue, 03 Nov 2015 23:50:00 -0000 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Mike Stump CC: Daniel Gutson , Aurelio Remonda , libstdc++@gcc.gnu.org, "gcc-patches@gcc.gnu.org" , daniel.gutston@tallertechnologies.com, Jonathan Wakely Subject: Re: [PATCH] Add configure flag for operator new (std::nothrow) References: <1446554133-3090-1-git-send-email-aurelio.remonda@tallertechnologies.com> <56391843.1070807@gmail.com> <563922C6.7080706@gmail.com> <3937336D-6170-4513-A658-A2835E87FB0C@comcast.net> In-Reply-To: <3937336D-6170-4513-A658-A2835E87FB0C@comcast.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00283.txt.bz2 On 11/03/2015 04:08 PM, Mike Stump wrote: > On Nov 3, 2015, at 1:10 PM, Martin Sebor wrote: >> The "as if" requirement implies that any observable effects of >> "the (possibly replaced) ordinary version" must be preserved. >> The repeated calls to the new handler are among such effects. > > Unless the standard is fixed to say that one cannot observe the repeated calls. We do this in some places, for some things: There are two sets of important observable effects: the calls to the handler, and the call to the (possibly replaced) ordinary operator new. A C++ program is allowed to replace just the ordinary operator new (and not the nothrow version), call the default nothrow operator new, and expect to get back the same pointer that would have been returned from the replaced new had it been called instead. (Some implementations, including libstdc++, fail to conform to this requirement.) Changing the standard to remove the requirement to preserve these effects would break the portability of programs that rely on it. Martin