Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Sat, 07 Dec 2024 06:16:29 -0800
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <86bjxnk282.fsf@linuxsc.com>
References: <87frnbt9jn.fsf@nosuchdomain.example.com> <877c8nt255.fsf@nosuchdomain.example.com> <20241129142810.00007920@yahoo.com> <20241129161517.000010b8@yahoo.com> <87ldwx10gv.fsf@bsb.me.uk> <874j3j1ywx.fsf@bsb.me.uk> <86a5dbmmhu.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sat, 07 Dec 2024 15:16:30 +0100 (CET)
Injection-Info: dont-email.me; posting-host="e893c75044f434f201e517765b97f4e2";
logging-data="3286661"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FjbMPpOMbIDzhILEz/q/Pj/h9maoTH04="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:oP0bmyyZAFVaYIPBk8WfuARWWFg=
sha1:rJCUM8ybi5pJBcshnvBn818WqN4=
Bytes: 2678
Bart writes:
> On 04/12/2024 16:38, Tim Rentsch wrote:
>
>> Ben Bacarisse writes:
>>
>>> Bart writes:
>>>
>>>> On 03/12/2024 11:15, Ben Bacarisse wrote:
>>>>
>>>>> Bart writes:
>>>>> ...
>>>>>
>>>>>> If I write this
>>>>>>
>>>>>> int *A, B[10], C(int);
>>>>>>
>>>>>> My compiler tells me that:
>>>>>>
>>>>>> A is a local variable [...]
>>>>>> B is a local variable [...]
>>>>>> C is a function with return type of 'i32', taking one
>>>>>> unnamed parameter of type 'i32'.
>>>>>>
>>>>>> (Interestingly, it places C into module scope, so the same
>>>>>> declaration can also create names in different scopes!)
>>
>> That means your compiler is not compiling standard C. In standard C
>> all entities declared locally have block scope, not file scope.
>
> OK, it can be added to the list of things that make C harder to
> compile.
On the contrary, it makes C easier to compile, because there is no
need to check for different cases. There is a single rule that
applies to all local declarations.