From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 1EA973858C33 for ; Tue, 13 Sep 2022 10:47:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1EA973858C33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663066049; 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=HPtOVN7fc55Ic2PayFnNYmUSolzikZAj1OrqS7IllP4=; b=PK+zd7h6MHb+nE4um990t8oL60pblK2mJHmw6h6HyJ0LYZncUlWD8BPJXs/p+gf9Jb5/kG 2PweUt0z4MPHEOiopRAufskQLMaQHiBu5i+gijidDPbGsEhx5qTvpl8GhA0MjVQ38kOcn5 X9HqpJ8Bj4JN4lHQS+FpF6lCSeURY68= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-388-ZWbiCOVQP1CcaVfjMmIouQ-1; Tue, 13 Sep 2022 06:47:28 -0400 X-MC-Unique: ZWbiCOVQP1CcaVfjMmIouQ-1 Received: by mail-qk1-f200.google.com with SMTP id bl17-20020a05620a1a9100b006cdf19243acso7405560qkb.4 for ; Tue, 13 Sep 2022 03:47:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=HPtOVN7fc55Ic2PayFnNYmUSolzikZAj1OrqS7IllP4=; b=Gjez4scGHbGdnJ82C40jZeaKF1gKmez6yxC4b/Wbw6nYxcUv7AJHsphG/IspChLUF+ mwwHgfaUxs4vtE10Nt+P3JdExHnEV/+2tDIelSTYP7RtM8dzy9qw0PJQytABQ9POkspE eMPS9Go4akR4ZtuNQpdEywp2o5OFjM+J3t2704Q+krotsXR3IXbjbDRtf45P3dXbdxbR wwAEJwNEOhI4kYEKiFyMd46UxfLCtuflPd6p7iury5pCqBWzmx9d2Tf57FUAkNEIYSMG HhV+dl+ldnQkxiCU6lEGgnASu2Haqh7b9M2jvoocl/ShouNfmUdF9uxsi1j4csaJhbAg uCuQ== X-Gm-Message-State: ACgBeo3GLHMWuhHsW0KMECVG7Hkq1hmswpFWmF5PshVfH1R3ypB6Oo2k 4pEXLT+LCBe5aVfzJmVWK0gex1dlMklh7inOylMWnm5vRy9rSl62KfQ6D9vql8ffxI91lkx1gKP 55daVrUfePvp5Q9u59I0SoSxMKC6no1M= X-Received: by 2002:a05:620a:c9b:b0:6cb:cde2:27b5 with SMTP id q27-20020a05620a0c9b00b006cbcde227b5mr16739387qki.293.1663066048363; Tue, 13 Sep 2022 03:47:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR70vJQbxdCvhedhTdRiTLJNlu+GoQbIZdwTVrlGD/pZKWUgNSDuUx7T9oBJs9GKnpOPCzf7AtlZsbIC2Otxm7g= X-Received: by 2002:a05:620a:c9b:b0:6cb:cde2:27b5 with SMTP id q27-20020a05620a0c9b00b006cbcde227b5mr16739375qki.293.1663066048162; Tue, 13 Sep 2022 03:47:28 -0700 (PDT) MIME-Version: 1.0 References: <20220912173907.1766341-1-ppalka@redhat.com> In-Reply-To: <20220912173907.1766341-1-ppalka@redhat.com> From: Jonathan Wakely Date: Tue, 13 Sep 2022 11:47:17 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Squelch -Wparentheses warning with debug iterators To: Patrick Palka Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 12 Sept 2022 at 18:40, Patrick Palka via Libstdc++ wrote: > > I noticed compiling e.g. std/ranges/adaptors/join.cc with > -D_GLIBCXX_DEBUG -Wsystem-headers -Wall gives the warning: > > gcc/libstdc++-v3/include/debug/safe_iterator.h:477:9: warning: suggest = parentheses around =E2=80=98&&=E2=80=99 within =E2=80=98||=E2=80=99 [-Wpare= ntheses] > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK, thanks. > > libstdc++-v3/ChangeLog: > > * include/debug/safe_iterator.h (_GLIBCXX_DEBUG_VERIFY_OPERANDS): > Add parentheses to squelch -Wparentheses. > --- > libstdc++-v3/include/debug/safe_iterator.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/in= clude/debug/safe_iterator.h > index 33f7a86478a..117dc93de60 100644 > --- a/libstdc++-v3/include/debug/safe_iterator.h > +++ b/libstdc++-v3/include/debug/safe_iterator.h > @@ -40,7 +40,7 @@ > #endif > > #define _GLIBCXX_DEBUG_VERIFY_OPERANDS(_Lhs, _Rhs, _BadMsgId, _DiffMsgId= ) \ > - _GLIBCXX_DEBUG_VERIFY(!_Lhs._M_singular() && !_Rhs._M_singular() \ > + _GLIBCXX_DEBUG_VERIFY((!_Lhs._M_singular() && !_Rhs._M_singular()) \ > || (_Lhs._M_value_initialized() \ > && _Rhs._M_value_initialized()), \ > _M_message(_BadMsgId) \ > -- > 2.37.3.542.gdd3f6c4cae >