Deutsch   English   Français   Italiano  
<86bjxnk282.fsf@linuxsc.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: Tim Rentsch <tr.17687@z991.linuxsc.com>
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: <vi54e9$3ie0o$1@dont-email.me> <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> <vifcll$1q9rj$1@dont-email.me> <vifiib$1s07p$1@dont-email.me> <87ldwx10gv.fsf@bsb.me.uk> <vimtt4$27vv$1@dont-email.me> <874j3j1ywx.fsf@bsb.me.uk> <86a5dbmmhu.fsf@linuxsc.com> <viq3bv$10kq3$1@dont-email.me>
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 <bc@freeuk.com> writes:

> On 04/12/2024 16:38, Tim Rentsch wrote:
>
>> Ben Bacarisse <ben@bsb.me.uk> writes:
>>
>>> Bart <bc@freeuk.com> writes:
>>>
>>>> On 03/12/2024 11:15, Ben Bacarisse wrote:
>>>>
>>>>> Bart <bc@freeuk.com> 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.