Deutsch   English   Français   Italiano  
<vub9d1$3kfla$2@dont-email.me>

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

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Loops (was Re: do { quit; } else { })
Date: Wed, 23 Apr 2025 18:52:34 +0100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <vub9d1$3kfla$2@dont-email.me>
References: <vspbjh$8dvd$1@dont-email.me> <vti2ki$g23v$1@dont-email.me>
 <vtin99$vu24$1@dont-email.me> <vtiuf0$18au8$1@dont-email.me>
 <vtj97r$1i3v3$1@dont-email.me> <vtl166$36p6b$1@dont-email.me>
 <vtlcg0$3f46a$2@dont-email.me> <vtnekn$1fogv$1@dont-email.me>
 <vto2mb$20c4n$1@dont-email.me> <vtu4i5$3hteg$1@dont-email.me>
 <vtujko$3uida$1@dont-email.me> <hxOMP.335104$j2D.272394@fx09.iad>
 <20250419092849.652@kylheku.com> <vu0t5m$22rjp$1@dont-email.me>
 <vu0v2n$22n7b$4@dont-email.me> <vu4cp5$3aou8$1@paganini.bofh.team>
 <vu5ems$230jl$4@dont-email.me> <20250421145818.767@kylheku.com>
 <vu6mtu$3apt8$1@dont-email.me> <vu8e1h$t2cb$1@dont-email.me>
 <87selzyhvp.fsf@nosuchdomain.example.com> <vub6jt$3i20f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 23 Apr 2025 19:52:34 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="17e45e44728eb9bc3d7b9f503a0e88d8";
	logging-data="3817130"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19uPYSlwPFRO2jB7hIkvK4a"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IVKUVAR5Gn69HDQ3jCEVdCH1W8A=
Content-Language: en-GB
In-Reply-To: <vub6jt$3i20f$1@dont-email.me>

On 23/04/2025 18:05, David Brown wrote:
> On 23/04/2025 00:02, Keith Thompson wrote:

>> C23 does not have _Lengthof.  It's proposed for C2y.
>>
> 
> Sorry, yes.  The pdf I was viewing was the latest draft for post-C23 
> rather than C23.  My mistake.


Actually, my C compiler has 'lengthof'. I'd got rid of most experimental 
bits in the lastest version, but that got left in:

   #include <stdio.h>

   int main(void) {
       int A[100];

       printf("%zu\n", lengthof(A));              # shows 100
   }

Looking at the sources, it is a sub-operator of 'sizeof' and its 
implementation took under 30 extra lines.

It works for expressions and types, just like sizeof.