Deutsch English Français Italiano |
<20241204135653.00004f01@yahoo.com> 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: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: question about linker Date: Wed, 4 Dec 2024 13:56:53 +0200 Organization: A noiseless patient Spider Lines: 60 Message-ID: <20241204135653.00004f01@yahoo.com> References: <vi54e9$3ie0o$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> <viia55$2mrc9$1@dont-email.me> <vinftq$2sv5n$1@paganini.bofh.team> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Wed, 04 Dec 2024 12:56:02 +0100 (CET) Injection-Info: dont-email.me; posting-host="1a483ca7e101f9d13f54e5e199a72345"; logging-data="866985"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+m/PxAPhSlwmkGqFrDwGv+d79ZAXxvvUI=" Cancel-Lock: sha1:MjHno2iV1aLAEUJMDS7Wt/VGly8= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 3414 On Tue, 3 Dec 2024 17:42:20 -0000 (UTC) antispam@fricas.org (Waldek Hebisch) wrote: > David Brown <david.brown@hesbynett.no> wrote: > > 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? > > Michael probably meant 'constexpr'. No, I am afraid of cases where function is used without prototype and then there is conflicting definition later in the module. Of course, it's UB, but in practice it could often work fine. Something like that: static int bar(); int foo(void) { return bar(42); } static int bar(int a, int b) { if (a == 42) return -1; return a - b; } Under c23 rules the code above is illegal, but before c23 it's merely a UB.