Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.std.c
Subject: Re: bit-fields of type unsigned long and unsigned long long
Date: Sat, 10 Jul 2021 08:58:19 -0700
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <86r1g688kk.fsf@linuxsc.com>
References: <86fsx8bh88.fsf@linuxsc.com> <878s2zw30y.fsf@nosuchdomain.example.com> <87v962vrh3.fsf@nosuchdomain.example.com> <87a6neuxjo.fsf@nosuchdomain.example.com> <8735t6no5f.fsf@bsb.me.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="e13df7ffef68eec8a0b0a92150d2f271"; logging-data="2695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lluVenLNdXH3n3hHa9DgPH/9s94WZGbY="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:Uej9ho3rPYtdUaR/MoluREKghns= sha1:CoNNHKKsUCRxh0JqGgpE8vrjddk=
Xref: csiph.com comp.std.c:6265
Ben Bacarisse writes:
[...]
> It seems wrong for bit fields have an explicit type at all. What they
> need is only the signed/unsigned distinction for which there are already
> keywords.
I was about to say that I completely agree, but there is an
important exception, namely _Bool. A bitfield of type _Bool
has different semantics than a bitfield of type unsigned :1.