From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyKxe-0001yS-Ay for qemu-devel@nongnu.org; Fri, 29 May 2015 10:08:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyKxZ-0002d0-Ve for qemu-devel@nongnu.org; Fri, 29 May 2015 10:08:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyKxZ-0002cv-Od for qemu-devel@nongnu.org; Fri, 29 May 2015 10:08:29 -0400 Date: Fri, 29 May 2015 15:08:24 +0100 From: "Daniel P. Berrange" Message-ID: <20150529140824.GB10986@redhat.com> References: <1432137106-8295-1-git-send-email-afaerber@suse.de> <20150521115346.GJ23116@redhat.com> <556609E1.2000004@suse.de> <20150529135100.GA14821@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PULL 00/12] QOM devices patch queue 2015-05-20 Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , David Gilbert , Andreas =?utf-8?Q?F=C3=A4rber?= , Eduardo Habkost , QEMU Developers On Fri, May 29, 2015 at 02:57:12PM +0100, Peter Maydell wrote: > On 29 May 2015 at 14:51, Daniel P. Berrange wrote: > > Since that caused failure with glib 2.22 could you revert that switch > > to g_assert_null/nonnull. > > BTW, David Gilbert is looking at whether we can use the glib support > to make use of "newer than version X" APIs a compile error everywhere > rather than just on boxes with the older glib, which should help > cut down on this kind of problem in future. It seem these g_assert_nonnull/null functions are in fact just trivial macros, so we could alternatively add them to our glib-compat.h file #define g_assert_true(expr) G_STMT_START { \ if G_LIKELY (expr) ; else \ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ "'" #expr "' should be TRUE"); \ } G_STMT_END #define g_assert_false(expr) G_STMT_START { \ if G_LIKELY (!(expr)) ; else \ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ "'" #expr "' should be FALSE"); \ } G_STMT_END #define g_assert_null(expr) G_STMT_START { if G_LIKELY ((expr) == NULL) ; else \ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ "'" #expr "' should be NULL"); \ } G_STMT_END #define g_assert_nonnull(expr) G_STMT_START { \ if G_LIKELY ((expr) != NULL) ; else \ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ "'" #expr "' should not be NULL"); \ Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|