Paul Eggert wrote:
> > # define verify_type__(R) \
> > struct { int verify_error_if_negative_size__ : (R) ? 2 : -1; }
>
> Thanks. I installed that.
Now one more simplification is possible: A variable declaration does it
just as nicely as a function declaration. Tested with gcc, Solaris cc, IRIX cc.
*** lib/verify.h 23 Sep 2005 22:59:59 -0000 1.5
--- lib/verify.h 26 Sep 2005 12:30:01 -0000
***************
*** 35,41 ****
/* Verify requirement R at compile-time, as a declaration. */
# define verify(R) \
! extern int (* verify_function__ (void)) [sizeof (verify_type__ (R))]
/* Verify requirement R at compile-time, as an expression.
This macro can be used in some contexts where verify cannot, and vice
versa.
--- 35,41 ----
/* Verify requirement R at compile-time, as a declaration. */
# define verify(R) \
! extern int verify_variable__ [sizeof (verify_type__ (R))]
/* Verify requirement R at compile-time, as an expression.
This macro can be used in some contexts where verify cannot, and vice
versa.
Bruno
_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib