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 01:01:30 +0200

I wrote:
> 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.

I checked this in:

2005-09-24  Jim Meyering  <address@hidden>

        * verify.h (verify_type__): Use `unsigned int' as the bitfield type
        so we can once again use a positive bitfield width of 1 -- now we
        don't have to explain why we were using a bitfield width of 2.




reply via email to

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