Sujet : Re: question about linker
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.lang.cDate : 03. Dec 2024, 12:15:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87ldwx10gv.fsf@bsb.me.uk>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Gnus/5.13 (Gnus v5.13)
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 with type 'ref i32' (expressed in other syntax)
B is a local variable with type '[10]i32'
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!)
A small correction: that declaration gives all three names the same
scope[1]. You are confusing scope with linkage.
[1] Well almost the same. The scope of A includes the declarators for B
and C, and the scope of B includes the declarator for C.
-- Ben.