Deutsch   English   Français   Italiano  
<1000cs3$2234m$1@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: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.lang.c
Subject: Re: Loops (was Re: do { quit; } else { })
Date: Tue, 13 May 2025 23:16:49 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <1000cs3$2234m$1@dont-email.me>
References: <vspbjh$8dvd$1@dont-email.me> <vtc19j$2kqlj$1@dont-email.me>
 <87a58mqt2o.fsf@nosuchdomain.example.com> <vtc7mp$2q5hr$1@dont-email.me>
 <vtcqf6$3j95s$1@dont-email.me> <vtdh4q$b3kt$1@dont-email.me>
 <vtf7fe$1qtpg$1@dont-email.me> <vtgfuf$31ug1$1@dont-email.me>
 <20250413072027.219@kylheku.com> <vtgpce$39229$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>
 <20250415153419.00004cf7@yahoo.com> <86h62078i8.fsf@linuxsc.com>
 <20250504180833.00000906@yahoo.com> <86plggzilx.fsf@linuxsc.com>
 <vvnsvt$3k1mu$1@dont-email.me> <86ldr4yx0x.fsf@linuxsc.com>
 <vvpmm2$3dhl$1@dont-email.me> <vvpsji$4jht$1@dont-email.me>
 <vvr5mg$l85c$1@dont-email.me> <vvt2tg$14otk$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 13 May 2025 23:16:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8a7f9759413c4980109b7dbb13e910aa";
	logging-data="2165910"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+ORij5RAfSKYWKeQiL/Har"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:3zvt8+4jxdp52GFNLJ+eKNb1Efo=
In-Reply-To: <vvt2tg$14otk$2@dont-email.me>
X-Enigmail-Draft-Status: N1110

On 12.05.2025 17:08, David Brown wrote:
> On 11/05/2025 23:43, James Kuyper wrote:
[...]
>>
>> More precisely, it makes it undefined behavior for values to point to an
>> array of less than 10 doubles.
> 
> The wording of the C standard (C11, as that's what I have open at the
> moment) is :
> 
> """
> If the keyword static also appears within the [ and ] of the array type
> derivation, then for each call to the function, the value of the
> corresponding actual argument shall provide access to the first element
> of an array with at least as many elements as specified by the size
> expression.
> """

Oh! - This is somewhat surprising to me. - When I first read about
the "arr[static N]" I assumed that it would be possible to pass any
sub-array, say "&arr[8]" (or "arr+8") as long as it's large enough
to still have N elements from the starting point, but the quote says
explicitly "access to the _first_ element of an array" (which I'd
interpret as "&arr[0]" (or "arr"). - Unless I misinterpreted that;
what would be the reason for that?

Janis

> [...]