From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6767 invoked by alias); 5 Dec 2019 20:38:31 -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 6739 invoked by uid 89); 5 Dec 2019 20:38:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=card X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Dec 2019 20:38:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575578307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1efptwQv2Pwx4QCwLUefMhGQ3zj0WklXIJ9EPDi+aZU=; b=YVOcBf6GIJkCgiMDVqJ4w5MhQmSHZQA8qjcjvCquWp1E7CGAulyk3Gw2H/3dEaYev8O7h5 uSylh4hzKt98DcQqwXcJPT0z4ZNg9543o8xbsRyYqPKru5I/NaiLzMUMl5H8ek00MAkCqH RwIdvYzaUkVxKcehRaJy+BVAAFJFTPA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-9KxBZHqWOC25XKyqV17LtQ-1; Thu, 05 Dec 2019 15:38:21 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC36F8017DF; Thu, 5 Dec 2019 20:38:19 +0000 (UTC) Received: from redhat.com (ovpn-122-138.rdu2.redhat.com [10.10.122.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F8775D6A3; Thu, 5 Dec 2019 20:38:18 +0000 (UTC) Date: Thu, 05 Dec 2019 20:38:00 -0000 From: Marek Polacek To: Segher Boessenkool Cc: Jonathan Wakely , Michael Matz , Thomas Schwinge , "gcc@gcc.gnu.org" , gcc-patches , "fortran@gcc.gnu.org List" Subject: Re: [RFC] Characters per line: from punch card (80) to line printer (132) (was: [Patch][OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments) Message-ID: <20191205203815.GO119925@redhat.com> References: <8be82276-81b1-817c-fcd2-51f24f5fe2d2@codesourcery.com> <20191205151515.GS10088@tucnak> <87lfrq6ahm.fsf@euler.schwinge.homeip.net> <20191205200650.GI3152@gate.crashing.org> MIME-Version: 1.0 In-Reply-To: <20191205200650.GI3152@gate.crashing.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-SW-Source: 2019-12/txt/msg00380.txt.bz2 On Thu, Dec 05, 2019 at 02:06:50PM -0600, Segher Boessenkool wrote: > Hi! >=20 > On Thu, Dec 05, 2019 at 05:03:43PM +0000, Jonathan Wakely wrote: > > C++17 introduces a nice feature, with rationale similar to declaring > > variables in a for-loop init-statement: > >=20 > > if (auto var =3D foo(); bar(var)) >=20 > Similar to GNU C statement expressions, which are *also* only a good > idea to use in limited cases. >=20 > > The variable is only in scope for the block where you need it, just > > like a for-loop. > >=20 > > Unfortunately nearly every time I've tried to use this recently, I've > > found it's impossible in 80 columns, e.g. this from yesterday: > >=20 > > if (auto __c =3D __builtin_memcmp(&*__first1, &*__first2, __len) <= =3D> > > 0; __c !=3D 0) > > return __c; > >=20 > > When you're forced to uglify every variable with a leading __ you run > > out of characters pretty damn quickly. >=20 > If using this "nice feature" forces you to uglify your code, then maybe > it is not such a nice feature, and you should not use it. I disagree, it is a nice feature, without quotes. It's Good Style not to leak variables into enclosing scopes. > If you have issues with scoping your functions are WAY too long already. I don't think that's the case here. -- Marek Polacek =E2=80=A2 Red Hat, Inc. =E2=80=A2 300 A St, Boston, MA