Deutsch   English   Français   Italiano  
<vjaplo$17cob$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: James Kuyper <jameskuyper@alumni.caltech.edu>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Tue, 10 Dec 2024 20:25:12 -0500
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <vjaplo$17cob$1@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vibr1l$vvjf$1@dont-email.me>
 <vic73f$1205f$1@dont-email.me> <20241129142810.00007920@yahoo.com>
 <vicfra$13nl4$1@dont-email.me> <20241129161517.000010b8@yahoo.com>
 <vicque$15ium$2@dont-email.me> <vid110$16hte$1@dont-email.me>
 <87mshhsrr0.fsf@nosuchdomain.example.com> <vidd2a$18k9j$1@dont-email.me>
 <8734j9sj0f.fsf@nosuchdomain.example.com> <vidnp3$1ovvm$2@paganini.bofh.team>
 <vihpjh$2hgg1$1@dont-email.me> <vihrh1$2hk5l$1@dont-email.me>
 <vii0jp$2jkd9$1@dont-email.me> <viifv8$2opi7$1@dont-email.me>
 <vik28b$390eg$1@dont-email.me> <vik8tc$3ang9$1@dont-email.me>
 <vikjff$3dgvc$1@dont-email.me> <viku00$3gamg$1@dont-email.me>
 <vil0qc$3fqqa$3@dont-email.me> <vil82t$3ie9o$2@dont-email.me>
 <vila9j$3j4dg$1@dont-email.me> <vin4su$49a6$1@dont-email.me>
 <vin95m$5da6$1@dont-email.me> <vinh3h$7ppb$1@dont-email.me>
 <vinjf8$8jur$1@dont-email.me> <vip5rf$p44n$1@dont-email.me>
 <viprao$umjj$1@dont-email.me> <viqfk9$13esp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 11 Dec 2024 02:25:14 +0100 (CET)
Injection-Info: dont-email.me; posting-host="bba43852df68bc0bc6dea6dfa4046055";
	logging-data="1291019"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18FwnN0RtBSfbkx27IO4O4ZYyKyVmeeG3A="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:VBJYKbOwAT2o94Pdg++As6HRpIA=
Content-Language: en-US
In-Reply-To: <viqfk9$13esp$1@dont-email.me>
Bytes: 3777

On 12/4/24 15:55, David Brown wrote:
> On 04/12/2024 16:09, Bart wrote:
....
>> My remarks have been about the namespace that is created by a module.
>>
>> I understand that C++ namespaces can be created in other ways, like 
>> classes. 
> 
> In reference to C++, I have been using the term "namespaces" the way C++ 
> specifically defines the term "namespace".  Perhaps I should have given 
> a reference to that in some way - this is comp.lang.c, after all.
> 
> What you are now talking about is what C calls "name spaces" - with a 
> space.  C++ does not use that term in its standards (at least, not in 
> the C++20 standards I have open here) - it does not have a clear name 
> for the concept, as far as I have found.  (I am not nearly as familiar 
> with the C++ standards as I am with the C standards, so if this matters 
> then perhaps someone else can chime in.)

The latest version of the C++ standard that I have is n4860.pdf, dated
2020-03-31. It has two occurrences of the phrase "name space" outside of
the section that descries differences from C:

8.2p1: "Labels have their own name space ..."
15.6p8: "There is one name space for macro names."

All other C++ identifiers reside in the ordinary name space

Those three namespaces all exist in C. In addition, each C struct or
union has a separate name space; C++ does not have the same rule, but
achieves a similar effect by giving those names a distinct scope.

In C struct, union, and enumation tags have their own namespace, in C++
they reside in the ordinary name space.

Half of all the differences between C and C++ that result in textually
identical code having different well-defined behavior in each language
are tied to differences in how name spaces and scopes work. Those
differences are deeply fundamental, and not easily removed.