From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe29.google.com (mail-vs1-xe29.google.com [IPv6:2607:f8b0:4864:20::e29]) by sourceware.org (Postfix) with ESMTPS id 0CA6C3836C4E for ; Tue, 26 Jan 2021 11:54:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CA6C3836C4E Received: by mail-vs1-xe29.google.com with SMTP id n18so8831780vsa.12 for ; Tue, 26 Jan 2021 03:54:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nhyeH3vpUBL6QAggqLOKS3Iy2fUI615kGwdCXViidfo=; b=ZrPS1E7AWm6MMwiOEIijMpNplc4BodRrnzq9kYY/5pIjEx9rk7ELDIGLXQpAtExCKa X1ed7/wKXpJpKfE1zBRJxn77DWPMjeEbeYX7sh/Ksuq8AR1ne+NwacWPu/KH+9AHC3Ve YvP00PSP1L+2Zi6YF4DEY6BGDzEJkgtZjPS2HL3R1+W8lDuFZrB8flzDoEkpIc1dX71u wyW5S4UbSP+1bnxv8U4dgXgyRxu+ZcBs24MmQJFnWXxyRkpLOgmFCgQo0hXMq1dp1YJl ts9pnceMJJ7R0ibgb5ZDyJJu497VzG49ReC7nHZDUwkN2bA0eNnZwFlt1pne+u4vz4aD hrfw== X-Gm-Message-State: AOAM533PUry85VCXTklYr7fT6TSNrpu97yZWAUbwOI+q9dGPpEJs6KjS 4cpbwRMXNNsjK/Zo00mYcqSv4/o1kwBYu8orn08Sgw== X-Google-Smtp-Source: ABdhPJyJzTX0ktsvUKGw0nU6tMJYiWFLUW+sMClYdHheIiwSSd2gpdWZ8dccMW1fuuBJ69/n5wQyv3g/+R1IMvOetek= X-Received: by 2002:a67:18c6:: with SMTP id 189mr3833709vsy.54.1611662088425; Tue, 26 Jan 2021 03:54:48 -0800 (PST) MIME-Version: 1.0 References: <20210126095655.2964881-1-maennich@google.com> In-Reply-To: <20210126095655.2964881-1-maennich@google.com> From: Giuliano Procida Date: Tue, 26 Jan 2021 11:54:12 +0000 Message-ID: Subject: Re: [PATCH] abipkgdiff: Address operator precedence warning To: Matthias Maennich Cc: Giuliano Procida via Libabigail , Dodji Seketeli , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-29.8 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2021 11:54:51 -0000 On Tue, 26 Jan 2021 at 09:57, Matthias Maennich wrote: > > When compiling with clang, it (rightfully) complains about an operator > precedence issue: > > abipkgdiff.cc:1646:7: error: operator '?:' has lower precedence than '<<'; '<<' will be evaluated first [-Wparentheses] > ? string("Comparison against self SUCCEEDED\n") > ^ > > Fix that by properly placing the parentheses. Also, drop the superfluous > string conversion. > > * tools/abipkgdiff.cc (compare_to_self): address clang warning. > > Signed-off-by: Matthias Maennich Reviewed-by: Giuliano Procida Looks good to me. > --- > tools/abipkgdiff.cc | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc > index 783a8d9a5359..c2badadb5973 100644 > --- a/tools/abipkgdiff.cc > +++ b/tools/abipkgdiff.cc > @@ -1642,9 +1642,9 @@ compare_to_self(const elf_file& elf, > > if (opts.verbose) > emit_prefix("abipkgdfiff", cerr) > - << (s == abigail::tools_utils::ABIDIFF_OK) > - ? string("Comparison against self SUCCEEDED\n") > - : string("Comparison against self FAILED\n"); > + << "Comparison against self " > + << (s == abigail::tools_utils::ABIDIFF_OK ? "SUCCEEDED" : "FAILED") > + << '\n'; > return s; > } > > -- > 2.30.0.280.ga3ce27912f-goog >