From c9d4f3aabd9d90ff14a61b564ceaa25dbd49e6a7 Mon Sep 17 00:00:00 2001 From: Matthias Maennich via libabigail Date: Mon, 15 Apr 2019 18:05:15 +0100 Subject: [PATCH] abg-reader: clarify boolean use of assignment When compiling with clang, the following warning is emitted: abg-reader.cc:1981:15: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] while (corp = read_corpus_from_input(ctxt)) ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ That is certainly a common pitfall and can be mitigated by placing parentheses around the assignment. * src/abg-reader.cc: clarify boolean use of assignment Signed-off-by: Matthias Maennich --- src/abg-reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 2204e15..69329d1 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -1978,7 +1978,7 @@ read_corpus_group_from_input(read_context& ctxt) ctxt.set_corpus_node(node); corpus_sptr corp; - while (corp = read_corpus_from_input(ctxt)) + while ((corp = read_corpus_from_input(ctxt))) ctxt.get_corpus_group()->add_corpus(corp); xmlTextReaderNext(reader.get()); -- 2.7.4