GNOME Bugzilla – Bug 626549
G_STATIC_ASSERT_EXPR
Last modified: 2011-05-28 02:37:54 UTC
In gatomic.h one finds many lines of code like this: # define g_atomic_pointer_get(atomic) \ ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \ (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic))) Lets add G_STATIC_ASSERT_EXPR() to hide the verbose assertion expression.
*** Bug 648426 has been marked as a duplicate of this bug. ***
Something like #define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1])) ?
Created attachment 188342 [details] [review] Add G_STATIC_ASSERT_EXPR macro
Review of attachment 188342 [details] [review]: Looks good to me. Will you also do the companion patch to use G_STATIC_ASSERT_EXPR in gatomic.h ?
Review of attachment 188342 [details] [review]: set patch status
The following fix has been pushed: c00ef0a Add G_STATIC_ASSERT_EXPR macro
Created attachment 188796 [details] [review] Add G_STATIC_ASSERT_EXPR macro