Deutsch   English   Français   Italiano  
<42fcea7270de500367eceea7ad5530fd@www.novabbs.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: learningcpp1@gmail.com (m137)
Newsgroups: comp.lang.c
Subject: Re: Representation of =?UTF-8?B?X0Jvb2w=?=
Date: Fri, 17 Jan 2025 02:47:49 +0000
Organization: novaBBS
Message-ID: <42fcea7270de500367eceea7ad5530fd@www.novabbs.com>
References: <87tums515a.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
	logging-data="3958173"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="JG0JkxZ+5IdCisX5eRWdXntV6FCBxhR6dunJoNlQ9Mw";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: f0f22f40c509162179733a15c025adca3fb62e9a
X-Rslight-Site: $2y$10$EF1puSbL/MjWZ7Bg/j.aheIawabTVmZzDFfJFf1tMCtx8eEu8lUoC
X-Spam-Checker-Version: SpamAssassin 4.0.0
Bytes: 2544
Lines: 34

Hi Keith,

Thank you for posting this. I noticed that the newer drafts of C23
(N2912 onwards, I think) have replaced the term "trap representation"
with "non-value representation":
- **Trap representation** was last defined in [N2731
3.19.4(1)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2912.pdf#page=)
as "an object representation that need not represent a value of the
object type."
- **Non-value representation** is most recently defined in [N3435
3.26(1)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3435.pdf#page=23)
as "an object representation that does not represent a value of the
object type."

The definition of non-value representation rules out object
representations that represent a value of the object type from being
non-value representations. So it seems to be stricter than the
definition of trap representation, which does not seem to rule out such
object representations from being trap representations. Is this
interpretation correct?

If so, what happens to the 254 trap representations that GCC and Clang
reserve for `_Bool`? Assuming a width of 1, each of those 254 object
representations represents a value in `_Bool`'s domain (the half whose
value bit is 1 represents the value `true`, while the other half whose
value bit is 0 represents the value `false`), so they cannot be thought
of as non-value representations (since a non-value representation must
be an object representation that **does not** represent a value of the
object type).

I've been stuck on this for quite some time, so would be grateful for
any guidance you could provide.


Thank you