From 5796293021919763414
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,47ad86575b18887f
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-07-23 11:35:05 PST
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
From: "C. M. Heard" <heard@vvnet.com>
Subject: Re: unnamed namespace quesion
Organization: none
References: <JhK47.359227$p33.7267027@news1.sttls1.wa.home.com> 
            <3B54E127.E35402FF@wizard.net> 
            <%9657.11405$Up.339914@sea-read.news.verio.net> 
            <b+QzDXARHdV7EwMg@ntlworld.com> 
            <u4s57.11507$Up.342471@sea-read.news.verio.net>
            <Ry+xgwCrkxV7Ewsg@ntlworld.com>
Newsgroups: comp.std.c++
Message-ID: <EDP57.11614$Up.345384@sea-read.news.verio.net>
X-Complaints-To: abuse@verio.net
X-Trace: sea-read.news.verio.net 995608164 206.184.139.148 (Fri, 20 Jul 2001 05:49:24 GMT)
NNTP-Posting-Date: Fri, 20 Jul 2001 05:49:24 GMT
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Date: Mon, 23 Jul 2001 13:33:30 CST
Lines: 43
Xref: archiver1.google.com comp.std.c++:6652

Francis Glassborow wrote:
>In article <u4s57.11507$Up.342471@sea-read.news.verio.net>, C. M. Heard
><heard@vvnet.com> writes
>>No, I meant 'namespace scope'.  I used that term because it's what appears
>>in the standard.  If I read the standard correctly, the older term 'file
>>scope' has been superseded by the term 'global scope' and is a special case
>>of 'namespace scope'.
>
>No, file scope is not the same as global scope. A static qualified
>declaration outside an explicit namespace has internal linkage and is at
>filescope, if it is not static qualified it has global scope. Yet
>another place for confusion to reign.

That would be a reasonable way to use those terms, but it's not the
way the C++ standard uses them.   The only place where the term
'file scope' is used is in the non-normative Annex C.  The normative
sections of interest are 3.3.5 and D.2, and this is what they say:

     3.3.5 Namespace scope                        [basic.scope.namespace] 
     [...]
     A name declared outside all named or unnamed namespaces (7.3),
     blocks (6.3), function declarations (8.3.5), function definitions
     (8.4) and classes (clause 9) has global namespace scope (also
     called global scope).  The potential scope of such a name begins
     at its point of declaration (3.3.1) and ends at the end of the
     translation unit that is its declarative region.  Names declared
     in the global namespace scope are said to be global.
     [ ...]
     D.2 static keyword                                     [depr.static] 
     The use of the static keyword is deprecated when declaring objects
     in namespace scope (see 3.3.5).

If you think this is confusing and was not what was intended then
perhaps a DR is in order.

Mike

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



