public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Matthias Maennich <maennich@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, gprocida@google.com, kernel-team@android.com,
	 maennich@google.com
Subject: [PATCH] abipkgdiff: Address operator precedence warning
Date: Tue, 26 Jan 2021 09:56:56 +0000	[thread overview]
Message-ID: <20210126095655.2964881-1-maennich@google.com> (raw)

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 <maennich@google.com>
---
 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


             reply	other threads:[~2021-01-26  9:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26  9:56 Matthias Maennich [this message]
2021-01-26 11:54 ` Giuliano Procida
2021-01-26 16:22   ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210126095655.2964881-1-maennich@google.com \
    --to=maennich@google.com \
    --cc=dodji@seketeli.org \
    --cc=gprocida@google.com \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).