Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"The four building blocks of the universe are fire, water, gravel and vinyl." -- Dave Barry


devel / comp.std.c / Re: bit-precise bit-fields

SubjectAuthor
* bit-precise bit-fieldsPhilipp Klaus Krause
`* Re: bit-precise bit-fieldsTim Rentsch
 `- Re: bit-precise bit-fieldsDavid Brown

1
bit-precise bit-fields

<sr1dpq$bch$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=436&group=comp.std.c#436

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: pkk...@spth.de (Philipp Klaus Krause)
Newsgroups: comp.std.c
Subject: bit-precise bit-fields
Date: Tue, 4 Jan 2022 13:15:54 +0100
Message-ID: <sr1dpq$bch$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 4 Jan 2022 12:15:54 -0000 (UTC)
Injection-Info: solani.org;
logging-data="11665"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:kvkqStURYCsb15vWKCxz5d4qTbA=
Content-Language: en-US
X-User-ID: eJwFwYEBwCAIA7CXYKVUz1GQ/09YQqRnKZIZHA4GeUR5Fdjmc+WYbhw9fWtrWyw3bPW1t/gDE2cQfA==
 by: Philipp Klaus Krause - Tue, 4 Jan 2022 12:15 UTC

C23 Bit-precise integer types
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) allow
programmers to explicitly state their intent on how many bits are
needed; but since they are addressable, they need padding bits when
their width is not a multiple of CHAR_WIDTH. Some implementations might
use more padding for alignment. Where there is a need to save memory,
they are thus not suitable. Using bit-precise integer types in
bit-fields solves this issue.

So, I'd like to see bit-fields of bit-precise integer types in C:

http://www.colecovision.eu/stuff/proposal-bit-precise-bit-fields.html

Re: bit-precise bit-fields

<86r196s11t.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=446&group=comp.std.c#446

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.std.c
Subject: Re: bit-precise bit-fields
Date: Mon, 17 Jan 2022 09:51:42 -0800
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <86r196s11t.fsf@linuxsc.com>
References: <sr1dpq$bch$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="15598caebf32ebbe97649a2f881af1fe";
logging-data="17642"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1IPQ7TuMfnlp+riHCKtDhLQDmxZOuMVs="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:Vst86uuyAqUUHrSIEcoJnQX+cdE=
sha1:QuJHGXmYz2OtVQbrOcAYHkQfKVE=
 by: Tim Rentsch - Mon, 17 Jan 2022 17:51 UTC

Philipp Klaus Krause <pkk@spth.de> writes:

> C23 Bit-precise integer types
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) allow
> programmers to explicitly state their intent on how many bits are
> needed; but since they are addressable, they need padding bits when
> their width is not a multiple of CHAR_WIDTH. Some implementations
> might use more padding for alignment. Where there is a need to save
> memory, they are thus not suitable. Using bit-precise integer types in
> bit-fields solves this issue.
>
> So, I'd like to see bit-fields of bit-precise integer types in C:
>
> http://www.colecovision.eu/stuff/proposal-bit-precise-bit-fields.html

I assume you are looking for feedback. I have some comments that
may sound harsh but they are not meant to be insulting. My
remarks are only about the proposal, and not about the author.

The proposal is terrible. It's poorly written, incomplete, not
fully thought out, confused, and insufficiently general. What is
being proposed (assuming my guesses are right about what that is)
offers nothing in the way of new expressive power and looks like
it will tend to be error prone in application.

Writing: start with a statement of new language constructs.
Give examples. When describing changes to the C standard, start
with an informal description of all the relevant changes, and
only afterwards give a list of specific changes to text in the
standard. Any justifications should be in a separate section
and after all description of what is being proposed. If there
needs to be a reference to some earlier submission such as N2774,
there should be a separate summary of what they say; don't make
the reader have to go looking for them.

The key element in the proposal is about a new kind of integer
type, but that isn't obvious, and furthermore really has nothing
to do with bitfields. The ramifications of introducing these
new types is enormous, and that is glossed over or ignored by
the proposal.

Minor point, but a significant one: the term "bit-precise" is an
awful choice of words. "Specified-width" is better, for example,
although others may be even better. Words are important, so an
effort should be made to find a suitably descriptive phrase.

There is more to say but I think these are the high order bits and
enough to get a conversation started, if you want to pursue it.

Re: bit-precise bit-fields

<ss4eis$dgc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=448&group=comp.std.c#448

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.std.c
Subject: Re: bit-precise bit-fields
Date: Mon, 17 Jan 2022 20:03:55 +0100
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <ss4eis$dgc$1@dont-email.me>
References: <sr1dpq$bch$1@solani.org> <86r196s11t.fsf@linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 17 Jan 2022 19:03:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="983fc8e39a26130b9202651315eb7997";
logging-data="13836"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Uc0zfU/9lSHuRiv0qClrLeUCvZhERnyA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:UFUbQmtu7cZN2sqJ9Fifh7nAo/s=
In-Reply-To: <86r196s11t.fsf@linuxsc.com>
Content-Language: en-GB
 by: David Brown - Mon, 17 Jan 2022 19:03 UTC

On 17/01/2022 18:51, Tim Rentsch wrote:
> Philipp Klaus Krause <pkk@spth.de> writes:
>
>> C23 Bit-precise integer types
>> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) allow
>> programmers to explicitly state their intent on how many bits are
>> needed; but since they are addressable, they need padding bits when
>> their width is not a multiple of CHAR_WIDTH. Some implementations
>> might use more padding for alignment. Where there is a need to save
>> memory, they are thus not suitable. Using bit-precise integer types in
>> bit-fields solves this issue.
>>
>> So, I'd like to see bit-fields of bit-precise integer types in C:
>>
>> http://www.colecovision.eu/stuff/proposal-bit-precise-bit-fields.html
>
> I assume you are looking for feedback. I have some comments that
> may sound harsh but they are not meant to be insulting. My
> remarks are only about the proposal, and not about the author.
>
> The proposal is terrible. It's poorly written, incomplete, not
> fully thought out, confused, and insufficiently general. What is
> being proposed (assuming my guesses are right about what that is)
> offers nothing in the way of new expressive power and looks like
> it will tend to be error prone in application.
>
> Writing: start with a statement of new language constructs.
> Give examples. When describing changes to the C standard, start
> with an informal description of all the relevant changes, and
> only afterwards give a list of specific changes to text in the
> standard. Any justifications should be in a separate section
> and after all description of what is being proposed. If there
> needs to be a reference to some earlier submission such as N2774,
> there should be a separate summary of what they say; don't make
> the reader have to go looking for them.
>
> The key element in the proposal is about a new kind of integer
> type, but that isn't obvious, and furthermore really has nothing
> to do with bitfields. The ramifications of introducing these
> new types is enormous, and that is glossed over or ignored by
> the proposal.
>
> Minor point, but a significant one: the term "bit-precise" is an
> awful choice of words. "Specified-width" is better, for example,
> although others may be even better. Words are important, so an
> effort should be made to find a suitably descriptive phrase.
>
> There is more to say but I think these are the high order bits and
> enough to get a conversation started, if you want to pursue it.
>

It looks like you missed the point of the proposal. It is building on
n2763, which introduces bit-precise integer types to C. It is not
adding any new integer types, but merely requiring an existing (in C +
n2763) type to be supported in bitfields. It is a minor feature, which
could perhaps have been added to n2763 rather than having a separate
proposal. It seems quite an obvious and appropriate addition.

You might think the term "bit-precise" is an awful choice of words, but
it is apparently what the committee picked during discussions of earlier
versions of n2763.

As far as I know, n2763 has been viewed positively by the committee, and
is implemented (at least approximately) in clang, but is not yet part of
the draft standard.

(As for being "insufficiently general", I would really like to see the
standard require bitfield support for all integer types and enumerated
types - in my experience, bitfields of types such as uint16_t are very
useful and fully supported by most compilers. But that would be a
different proposal.)


devel / comp.std.c / Re: bit-precise bit-fields

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor