Deutsch   English   Français   Italiano  
<vvt3fe$14otk$3@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: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: Loops (was Re: do { quit; } else { })
Date: Mon, 12 May 2025 17:18:06 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <vvt3fe$14otk$3@dont-email.me>
References: <vspbjh$8dvd$1@dont-email.me> <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> <87wmam4xa5.fsf@nosuchdomain.example.com>
 <868qn2zl1m.fsf@linuxsc.com> <vvrs5j$t9go$1@dont-email.me>
 <86o6vyxoit.fsf@linuxsc.com> <87zffi2n7j.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 12 May 2025 17:18:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e3915b4dce549afc73a1dd1d84017fcf";
	logging-data="1205172"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18C1cu/OvS2LCXvISWY1soIUWhhFAJOdL0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Cancel-Lock: sha1:CI/wY2t1jgv6MUOXpZkByVzQwvE=
In-Reply-To: <87zffi2n7j.fsf@nosuchdomain.example.com>
Content-Language: en-GB

On 12/05/2025 11:27, Keith Thompson wrote:
> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> [...]
>> It isn't just that checking the condition cannot be done in general.
>> To be reliable the parameter length information would need to be
>> part of the function's type.  That has implications for type
>> compatibility and also for the types of pointers-to-function.  And
>> it would mean that removing a 'static' array length specification on
>> a function definition would necessitate also changing the functions
>> declarations, plus any affected pointers-to-function.  Not worth it,
>> even if in theory it were doable.
> [...]
> 
> In my opinion, keeping a function's definition and declarations
> consistent is absolutely worth it, even if the language might not
> require it.
> 

Sure.  If gcc had a warning enforcing such consistency, I would 
definitely use it.

But not all C programmers are as pedantic about consistency between a 
function declaration and definition.  It is not uncommon to be 
inconsistent about the names of parameters (or even if the parameters 
have names at all), or mixing array-style parameters and pointer-style 
parameters.