"James Kuyper" <> wrote in message
news:ke1n9s$b13$...
> On 01/26/2013 04:22 PM, BartC wrote:
> ...
>> As for identifiers which are not static, and not extern (ie. defined here
>> and exported from this module), I've no idea now how they fit into the
>> picture. ...
>
> Because of the multiple meanings attached to the 'static' keyword by the
> C language, it's best to avoid using 'static' as an adjective all by
> itself. The relevant phrases are "internal linkage", "external linkage",
> and "no linkage", "static storage duration" and "automatic storage
> duration" (there are other storage durations, but they're not likely to
> be relevant in this context).
>
> Could you describe the category you're talking about in those terms?
>
> By "not static, and not extern", do you mean identifiers declared
> without using either of those keywords?
> Or, by "not static, and not extern", do you mean identifiers with
> neither internal nor external linkage? If so, they're an extremely
> diverse group, which means that there's very little that can usefully be
> said about the entire group. They include all struct, union, and enum
> tags and members. They include macro names, statement labels, typedef
> names, function parameter names, and all variables declared with block
> scope and without 'extern'.
>
> Or, by "not static, and not extern", do you mean identifiers with
> neither static storage duration nor external linkage? That's an even
> larger group, and there's corresponding less that can be usefully said
> about it the entire group.
Sorry, I thought I was being obvious. But perhaps there is something about
the terms 'extern' and 'external linkage' as used by C that I'm missing. To
me, 'external' means something that is imported. What I referred to as
'static' were things that are neither imported nor exported (ie local). The
last group, 'not static and not extern', I mean names that are exported.
Examples showing how my various groups are expressed in normal C (in my
preprocessed version, I make them more obvious):
local static int fna(void){}
exported int fnb(void){}
imported extern fnb(void);
or implicit
So imported, exported, or local. I would guess that C uses 'extern' to mean
both imported and exported names (fnb and fnc in my table).
I'm also talking about objects which, when exported or imported, need the
linker's help to achieve that. Not about structs, unions, enums, macros, or
typedefs, which can easily shared across modules simply by duplicating their
definitions in each module (by them appearing in a common header file for
example).
--
Bartc
|