public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: Matthias Maennich <maennich@google.com>
Cc: Giuliano Procida via Libabigail <libabigail@sourceware.org>,
	Dodji Seketeli <dodji@seketeli.org>,
	kernel-team@android.com
Subject: Re: [PATCH] abipkgdiff: Address operator precedence warning
Date: Tue, 26 Jan 2021 11:54:12 +0000	[thread overview]
Message-ID: <CAGvU0Hms6G4bKZ=TC0hVRdFmEkZtpdD13Y=ZZ-g8JniVgE4ZbA@mail.gmail.com> (raw)
In-Reply-To: <20210126095655.2964881-1-maennich@google.com>

On Tue, 26 Jan 2021 at 09:57, Matthias Maennich <maennich@google.com> 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 <maennich@google.com>
Reviewed-by: Giuliano Procida <gprocida@google.com>

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
>

  reply	other threads:[~2021-01-26 11:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26  9:56 Matthias Maennich
2021-01-26 11:54 ` Giuliano Procida [this message]
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='CAGvU0Hms6G4bKZ=TC0hVRdFmEkZtpdD13Y=ZZ-g8JniVgE4ZbA@mail.gmail.com' \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    --cc=maennich@google.com \
    /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).