In 'comp.lang.c', "Zhigang Cui" <zc**@nortelnetworks.com> wrote:
When I saw 'global static', the first response was there was no such
term. But I realized it's an idiom later. When we learn C language, when
we study C standard, when we study compiler, we use 'linkages of
identifiers', 'storage-class specifier'. One of my friends said maybe we
could use 'local static', :-)
Who could tell me when/where 'global static' came from? Are there some
other similar idioms?
Variables have a last two properties known as
- duration: bloc, permanent.
- scope: bloc, compile unit without external linkage, compile unit with
external linkage
-> A variable defined in a bloc has a bloc duration and a bloc scope.
-> A variable defined in a bloc with the static qualifier has a permanent
duration and a bloc scope.
-> A variable defined out of a function has a permanent duration and a
compile unit with external linkage scope.
-> A variable defined out of a function with the static qualifier has a
permanent duration and a compile unit without external linkage scope.
The case of the allocated variables is a little bit more complex. The scope
is, say, undefined, but the allocated block is accessible one or aliased
pointers.
As long as the object has been sucessfully created (*alloc()), the duration
is permanent. It ceased at the moment when the object is deleted (free()).
--
-ed- get my email here:
http://marreduspam.com/ad672570
The C-language FAQ:
http://www.eskimo.com/~scs/C-faq/top.html
C-reference:
http://www.dinkumware.com/manuals/reader.aspx?lib=c99
FAQ de f.c.l.c :
http://www.isty-info.uvsq.fr/~rumeau/fclc/