From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3fecPYAgKCpI8w0994y32AA270.yA874xwx42w47EAGDy0IwD0.AD2@flex--maennich.bounces.google.com> Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by sourceware.org (Postfix) with ESMTPS id 09FCB386180C for ; Tue, 26 Jan 2021 09:57:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 09FCB386180C Received: by mail-wm1-x34a.google.com with SMTP id s24so1194134wmj.3 for ; Tue, 26 Jan 2021 01:57:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=rJhu8Pi3YjC9B9O9x5Z+DUlU+YCEQ73EB86bEpdKmaA=; b=CGGkEx6nQkLkLv/A1aTLtx8W0/QcoevSFMUc1mD48iidBfJIpuGc3AmkfGVLc3Js49 m6HATCmZsgS7qsibNYd5551x5X9Pc4ydnsWUVyS1V9MA4aiMAnyHKW+P9Mwzk2HFXVH5 N+RMd7Zlt7abtwZtcqPOzdFjp65/xaQURaZlTYIx13zHA8kJZHpKyXCzJGwSGh+JxGDh srWBt3DuAgPAB412MGaJwJ3+LLhQ3dxj+mME+6FLUIf4pbwxIZjXUwTZpXeFJCEEIjh+ AVai5VH4NRGniJnZ7ILYzb7lYX2XLgwDANguQkKgAGQXQ3MbnK+w+C4ClkCkegztMB9C H7TQ== X-Gm-Message-State: AOAM530jUokfs0tUaXwX9u+HNnLQ3DZpSY4Ej7W6H8fUIo1i0MAMHTRy ves+oU9S0ClbbRE5zY5//OC2FHP13mGzBja+BzUb7cm3ai5MXcbqiN3XcYJF46jnEyaMsotQAzS v7fb+1LutiuifHPx+cmVCl4vANhHXsnJH48Foy0k81uC0XzTGHEkVSQg5Mt0vEBhCrVGJFQs= X-Google-Smtp-Source: ABdhPJwLmasScJM80vNCqCSd3pGa+pdD6MCUPQpEamPBBRrHt+CWf2nyVxBliNtRnEmtTn0cUfGyy9mEBe0Nwg== Sender: "maennich via sendgmr" X-Received: from lux.lon.corp.google.com ([2a00:79e0:d:210:7220:84ff:fe09:a3aa]) (user=maennich job=sendgmr) by 2002:a5d:6a02:: with SMTP id m2mr5198446wru.364.1611655037900; Tue, 26 Jan 2021 01:57:17 -0800 (PST) Date: Tue, 26 Jan 2021 09:56:56 +0000 Message-Id: <20210126095655.2964881-1-maennich@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH] abipkgdiff: Address operator precedence warning From: Matthias Maennich To: libabigail@sourceware.org Cc: dodji@seketeli.org, gprocida@google.com, kernel-team@android.com, maennich@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-23.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_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 09:57:20 -0000 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 --- 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