Received: from eggs.gnu.org ([2001:4830:134:3::10]:34248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrmtt-0006Ty-C1 for qemu-devel@nongnu.org; Thu, 29 Oct 2015 09:05:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zrmtp-0003J4-Ar for qemu-devel@nongnu.org; Thu, 29 Oct 2015 09:05:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrmtp-0003J0-4M for qemu-devel@nongnu.org; Thu, 29 Oct 2015 09:05:49 -0400 From: Markus Armbruster References: <1446020161-21758-1-git-send-email-armbru@redhat.com> <5630E8AC.4000900@redhat.com> Date: Thu, 29 Oct 2015 14:05:46 +0100 In-Reply-To: <5630E8AC.4000900@redhat.com> (Eric Blake's message of "Wed, 28 Oct 2015 09:24:28 -0600") Message-ID: <878u6l6d05.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PULL v2 00/14] QMP and QObject patches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Peter Maydell , QEMU Developers Eric Blake writes: > On 10/28/2015 09:07 AM, Peter Maydell wrote: > >>> glib: add compatibility interface for g_hash_table_add() >>> monitor: Turn monitor_qapi_event_state[] into a hash table > >> >> CC qga/commands-posix.o >> In file included from /Users/pm215/src/qemu-for-merges/qga/main.c:25: >> In file included from >> /Users/pm215/src/qemu-for-merges/include/qapi/qmp/json-parser.h:17: >> In file included from /Users/pm215/src/qemu-for-merges/include/qemu-common.h:25: >> /Users/pm215/src/qemu-for-merges/include/glib-compat.h:171:12: error: >> returning 'void' from a function with incompatible result type >> 'gboolean' (aka 'int') >> return g_hash_table_replace(hash_table, key, key) >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Looks like g_hash_table_replace was originally a 'void' return >> and switched to 'gboolean' return at some later date: >> >> https://github.com/GNOME/glib/commit/910191597a6c2e5d5d460e9ce9efb4f47d9cc63c The 80s are calling: cavalier API break. The GLib maintainers should know better. Anyway, this change is in 2.39.2. The replacement function is for <2.32. Therefore, g_hash_table_replace() will always return void then. > This patch series isn't using the return value of g_hash_table_add, so > our glib replacement could be changed to return void. Yes. Matches GLib's function before 2.39.2. > On the other hand, would it be better to proactively retrofit the return > type into ALL of the g_hash_table_* functions that were swapped to > return a value, so that future uses of the functions with qemu can make > use of the modern contract, even though this series doesn't use it? I think we should add glib-compat cruft only when we actually need it.