473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

When/Where does 'global static' come from?

Hi,
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?

Thanks in advance.
Nov 14 '05 #1
3 1639
On Mon, 12 Jul 2004 10:31:38 +0800, "Zhigang Cui"
<zc**@nortelnetworks.com> wrote in comp.lang.c:
Hi,
When I saw 'global static', the first response was there was no such term.
Your first response was correct. There is no such term in the C
standard. The word 'global' does not exist in the C standard.
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', :-)
A better idea is not to promote the use of sloppy terminology. It
causes confusion and can lead to errors in understanding.
Who could tell me when/where 'global static' came from? Are there some other
similar idioms?
I haven't the faintest idea where it came from, anymore than I have
any idea where 'void main()' came from. Other than it comes from
people who haven't learned the correct terminology.

Where I am from, students who go into fields that might involve
programming study in programs with names like 'computer engineering'
or 'computer science'. I don't know of any other field of engineering
or science where sloppy or imprecise terminology is encouraged or even
tolerated.
Thanks in advance.


Another such misuse is 'implicit cast'. A cast operator requests the
compiler to perform an conversion which might or might not be
performed automatically in the absence of the cast operator. There
can be no such thing as an 'implicit cast', there can be an automatic
conversion without a cast operator.

I find this annoying enough when technical writers use the phrase.
When I saw it in the output of a static code checking tool, written by
people who should understand the language standard, it considerably
lowered my opinion of that tool.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #2
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/
Nov 14 '05 #3
On Mon, 12 Jul 2004, Zhigang Cui wrote:
Hi,
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?


When you declare a variable it has scope and it has linkage. If you
declare the variable outside any function or block it has file scope. If
it external linkage then the variable is 'visible' to all parts of the
program. It is available 'globally'. Just as in English, if I say that
Coca Cola is available globally I mean that it is available everywhere.

The ISO and ANSI standards never use the term 'global' to describe the
scope of a variable. They call this file scope.

When you think about it, a static variable declared at file scope no
longer becomes 'global'. Thus the term 'global static' becomes an
oxymoron. English is full of oxymorons but the C standard is not.

The proper term for 'global static' is 'file scope, internal linkage'.

--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@whitehouse.gov
Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Steven T. Hatton | last post by:
In the following code, at what point is S::c fully defined? #include <iostream> using std::cout; using std::endl; using std::ostream; class C { int _v;
2
by: Gianguz | last post by:
I'd like to discuss about the opportunity to have a global objects creator that introduces into a general framework (suited for multithreading) a controlled semantic to manage globals variables...
10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
9
by: Simon | last post by:
Hi, I have written an ActiveX object to resize images and upload them to a database, this all works fine but when I close internet explorer the process iexporer.exe is still running in my task...
1
by: Divick | last post by:
Hi I want to know when does the storate allocation happens for member static data? For example I have following class declared in a header typedef void (*fptr)(void); class DllMethods {...
20
by: JohnQ | last post by:
The way I understand the startup of a C++ program is: A.) The stuff that happens before the entry point. B.) The stuff that happens between the entry point and the calling of main(). C.)...
43
by: Kislay | last post by:
Which of the following is correct regarding the storage of global variables : 1. Global variables exist in a memory area that exists from before the first reference in a program until after the...
1
by: daonho | last post by:
Hi Everyone, I have encountered this problem that I am not able to figure out. Please drop me some lines if you have any idea how to solve this issue. I have a global.asax file in my web site. It...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.