From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125051 invoked by alias); 20 Jan 2020 10:05:14 -0000 Mailing-List: contact libabigail-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Id: List-Subscribe: Sender: libabigail-owner@sourceware.org Received: (qmail 125041 invoked by uid 89); 20 Jan 2020 10:05:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-18.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy= X-Spam-Status: No, score=-18.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: relay12.mail.gandi.net Received: from relay12.mail.gandi.net (HELO relay12.mail.gandi.net) (217.70.178.232) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Jan 2020 10:05:04 +0000 Received: from localhost (91-166-131-130.subs.proxad.net [91.166.131.130]) (Authenticated sender: dodji@seketeli.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 9A22B20000A; Mon, 20 Jan 2020 10:05:00 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 56B5B18008A5; Mon, 20 Jan 2020 11:04:59 +0100 (CET) From: Dodji Seketeli To: Matthias Maennich Cc: libabigail@sourceware.org, kernel-team@android.com Subject: Re: [PATCH 1/2] corpus: is_empty: consider actual translation unit contents Organization: Me, myself and I References: <20200113144451.46359-1-maennich@google.com> <20200113144451.46359-2-maennich@google.com> X-Operating-System: Red Hat Enterprise Linux Workstation 7.8 Beta X-URL: http://www.seketeli.net/~dodji Date: Wed, 01 Jan 2020 00:00:00 -0000 In-Reply-To: <20200113144451.46359-2-maennich@google.com> (Matthias Maennich's message of "Mon, 13 Jan 2020 14:44:50 +0000") Message-ID: <875zh6v3xw.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2020-q1/txt/msg00030.txt Hello Matthias, Matthias Maennich a =C3=A9crit: [...] > diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc > index e37c35f5fbbb..bee87ddbb307 100644 > --- a/src/abg-corpus.cc > +++ b/src/abg-corpus.cc > @@ -859,7 +859,18 @@ corpus::set_architecture_name(const string& arch) > bool > corpus::is_empty() const > { > - return (priv_->members.empty() > + bool members_empty =3D true; > + for (translation_units::const_iterator i =3D priv_->members.begin(), > + e =3D priv_->members.end(); > + i !=3D e; ++i) > + { > + if (!(*i)->is_empty()) > + { > + members_empty =3D false; > + break; > + } > + } > + return (members_empty > && priv_->fun_symbol_map > && priv_->fun_symbol_map->empty() > && priv_->var_symbol_map This change obviously looks good to me. However, I think it's useful to update the comment of the corpus::is_empty function to say that the function tests if the corpus contains no non-empty translation unit. [...] > Hence, teach is_empty() to have a look at the actual translation units. > > * src/abg-corpus.cc (corpus::is_empty): consider a list of > empty members to be empty. This is thus OK to commit to master with the the comment update above. Thanks for working on this! Cheers, --=20 Dodji