Deutsch   English   Français   Italiano  
<viia55$2mrc9$1@dont-email.me>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Sun, 1 Dec 2024 19:33:08 +0100
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <viia55$2mrc9$1@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vi6sb1$148h7$1@paganini.bofh.team>
 <vi6uaj$3ve13$2@dont-email.me> <87plmfu2ub.fsf@nosuchdomain.example.com>
 <vi9jk4$gse4$1@dont-email.me> <vi9kng$gn4c$1@dont-email.me>
 <87frnbt9jn.fsf@nosuchdomain.example.com> <viaqh0$nm7q$1@dont-email.me>
 <877c8nt255.fsf@nosuchdomain.example.com> <viasv4$nm7q$2@dont-email.me>
 <vibr1l$vvjf$1@dont-email.me> <vic73f$1205f$1@dont-email.me>
 <20241129142810.00007920@yahoo.com> <vicfra$13nl4$1@dont-email.me>
 <20241129161517.000010b8@yahoo.com> <vicque$15ium$2@dont-email.me>
 <vid110$16hte$1@dont-email.me> <87mshhsrr0.fsf@nosuchdomain.example.com>
 <vidd2a$18k9j$1@dont-email.me> <8734j9sj0f.fsf@nosuchdomain.example.com>
 <vihhkj$2er60$1@dont-email.me> <vihjaj$2f79m$2@dont-email.me>
 <vihs4s$2hgg1$2@dont-email.me> <20241201185740.00004c30@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 01 Dec 2024 19:33:12 +0100 (CET)
Injection-Info: dont-email.me; posting-host="cb92292cff9a7aed5107a3020cf78af5";
	logging-data="2846089"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18+VsgUD3/tgjox1CB/PGUr7MdSHKvY5XY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0ZAfItcGkUQtbTPxJL6Cjmu/xUY=
Content-Language: en-GB
In-Reply-To: <20241201185740.00004c30@yahoo.com>
Bytes: 3855

On 01/12/2024 17:57, Michael S wrote:
> On Sun, 1 Dec 2024 15:34:04 +0100
> David Brown <david.brown@hesbynett.no> wrote:
>>
>> I can see some advantages in a language being happy with any order of
>> function definition, without requiring forward declarations to use a
>> function before it is defined.  But C is not like that, and I cannot
>> honestly say it bothers me one way or the other.  And apparently, it
>> does not particularly bother many people - there is, I think, no
>> serious impediment or backwards compatibility issue that would
>> prevent C being changed in this way.  Yet no one has felt the need
>> for it - at least not strongly enough to fight for it going in the
>> standard or being a common compiler extension.
>>
>>
>>
> 
> I think, arguing in favor of such change would be easier on top of
> the changes made in C23.
> Before C23 there were, as you put it "no serious impediment or
> backwards compatibility issue". After C23 we could more categorical
> claim that there are no new issues.
> 

Does that mean there was something that you think was allowed in C 
before C23, but not after C23, that would potentially be a problem here?

What, specifically, are you thinking of?

The changes in declarations in C23, AFAIK, are that "void foo();" now 
means the same as "void foo(void);", and that in general non-prototype 
function declarations are no longer allowed.  (That is a good change, of 
course - 30 years late, but still welcome.)  But I can't think of a 
situation where code that is correct under the current "declare before 
using" rule would no longer be correct if "declare before or after" were 
allowed at the file-scope level.

Maybe you could construct something by playing silly-buggers with macros 
to re-define identifiers at different points in the code.

I can't say I've thought much about the consequences of such a rule 
change - it doesn't seem a realistic change to me, and I have no problem 
with the current rule.  So it's quite possible that I've missed something.