From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39779 invoked by alias); 6 Aug 2016 10:09:35 -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 39770 invoked by uid 89); 6 Aug 2016 10:09:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=gladly, oleg.endo@t-online.de, olegendotonlinede, Hx-languages-length:1469 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 06 Aug 2016 10:09:34 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C64D07F3EB; Sat, 6 Aug 2016 10:09:31 +0000 (UTC) Received: from reynosa.quesejoda.com (vpn1-4-12.ams2.redhat.com [10.36.4.12]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u76A9TJ1029352; Sat, 6 Aug 2016 06:09:30 -0400 Subject: Re: protected alloca class for malloc fallback To: Richard Biener , Oleg Endo , Martin Sebor , gcc-patches References: <57A32741.7010003@redhat.com> <57A3F57F.3050509@gmail.com> <57A4A5E8.90205@redhat.com> <1470420954.639.64.camel@t-online.de> <44EE0FB0-A8B9-43F9-BF58-C4D7D27DA944@gmail.com> From: Aldy Hernandez Message-ID: <57A5B759.102@redhat.com> Date: Sat, 06 Aug 2016 10:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <44EE0FB0-A8B9-43F9-BF58-C4D7D27DA944@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-08/txt/msg00523.txt.bz2 On 08/05/2016 04:07 PM, Richard Biener wrote: > On August 5, 2016 8:15:54 PM GMT+02:00, Oleg Endo wrote: >> On Fri, 2016-08-05 at 19:55 +0200, Richard Biener wrote: >> >>> >>> Please don't use std::string. For string building you can use >>> obstacks. >>> >> >> Just out of curiosity ... why? I remember there was some discussion >> about it, what was the conclusion? Is that now a general rule or does >> it depend on the context where strings are used? > > Because you make a messy mix of string handling variants. Std::string is not powerful enough to capture all uses, it is vastly more expensive to embed into structs and it pulls in too much headers. Is this negotiable? I would prefer to use the standard library implementation of things when possible. At the very least, it's easier for others familiar with the C++ STL. I mean, we are using C++ after all :). I understand a reluctance in cases where it would be very inefficient, or where std::string is not up to speed. In such cases it makes sense to use obstacks or equivalents, but in straightforward things on a non critical path? I would gladly do either, but I would strongly prefer std::string when it does not overly pessimize code. > (Oh, and I hate I/o streams even more) Yeah, but that sounds like a personal preference? ;-). Let me know. I'll do either if it's an agreed upon mandate from the global deities :). Aldy