[Spice-devel] [PATCH spice-common 2/2] log: remove spice_static_assert macro

Christophe Fergeau cfergeau at redhat.com
Mon Jun 12 11:30:04 UTC 2017


On Mon, Jun 12, 2017 at 06:26:58AM -0400, Frediano Ziglio wrote:
> > > 
> > > > I think we should replace SPICE_VERIFY / verify with G_STATIC*
> > > > equivalents.
> > > >  
> > > 
> > > We actually can't for compatibility reason. Some version of GLib have
> > > broken macros and we still claim RHEL 6 support
> > > 
> > 
> > Ah, I vaguely recall some discussion, do you have a pointer? I can't find
> > changes in glib git log.
> > 
> 
> I think Christophe F pointed out the problem. Don't remember exactly, I
> think they were using array sizes but this do not work with C99.
> Looking at current GLib master code is still using that broken
> trick.

This is https://bugzilla.gnome.org/show_bug.cgi?id=758844
Test case from the bug is

int main (int argc, char **argv)
{
    G_STATIC_ASSERT(argc == 4);

    return 0;
}

which succeeds while the macro cannot know the value of argc.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170612/076959fd/attachment-0001.sig>


More information about the Spice-devel mailing list