[Spice-devel] [PATCH spice-common 2/2] log: remove spice_static_assert macro
Marc-André Lureau
marcandre.lureau at redhat.com
Mon Jun 12 11:46:07 UTC 2017
Hi
----- Original Message -----
> 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.
>
Thanks, too bad they didn't manage to introduce a verify-like solution.
(I wouldn't claim the glib macro to be broken though)
More information about the Spice-devel
mailing list