bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new gnulib module "verify" for compile-time assertions


From: Jim Meyering
Subject: Re: new gnulib module "verify" for compile-time assertions
Date: Sat, 24 Sep 2005 00:44:15 +0200

Bruno Haible <address@hidden> wrote:

> Paul Eggert wrote:
>> I suspect it may not be the last word, with all
>> these screwy compilers to test....).
>
> Indeed, IRIX 6.5 cc gives "warning: signed bitfield of length 1".
>
> Changing the verify_type__ macro like this makes it work without warning.
>
> # define verify_type__(R) \
>     struct { int verify_error_if_negative_size__ : (R) ? 2 : -1; }

Or just make the bitfield use type `unsigned int'.
Then people won't wonder why we used 2 instead of 1,
and we won't have to worry about documenting it, either.

# define verify_type__(R) \
    struct { unsigned int verify_error_if_negative_size__ : (R) ? 1 : -1; }
>
> Other than that, it works fine with AIX xlc, IRIX cc, HP-UX cc, OSF/1 4.0 cc.

Thanks for testing it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]