Deutsch English Français Italiano |
<vjdpct$1viqk$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: Wed, 11 Dec 2024 23:38:52 -0500 Organization: A noiseless patient Spider Lines: 32 Message-ID: <vjdpct$1viqk$1@dont-email.me> References: <vi54e9$3ie0o$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> <vjaplo$17cob$1@dont-email.me> <GY56P.6170$YoTc.5109@fx39.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Date: Thu, 12 Dec 2024 05:38:59 +0100 (CET) Injection-Info: dont-email.me; posting-host="de3dbcba55af471c7945b300d57fe3b1"; logging-data="2083668"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CXOQhe1JtC2Co8MLfC9nfzySi0BkUAQg=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:LVMfPFeyzOZocXKUdlBbzNJGPHM= In-Reply-To: <GY56P.6170$YoTc.5109@fx39.iad> Content-Language: en-US Bytes: 2652 On 12/10/24 20:32, Scott Lurndal wrote: > James Kuyper <jameskuyper@alumni.caltech.edu> writes: >> On 12/4/24 15:55, David Brown wrote: >>> On 04/12/2024 16:09, Bart wrote: .... >> In C struct, union, and enumation tags have their own namespace, in C++ >> they reside in the ordinary name space. > > In C++ they reside in the ordinary name space only if they're not > part of a named namespace. > > namespace x { > int y; > }; You're confusing name spaces and namespaces. Your example does not include any struct, union, or enumeration tags, so it's not directly relevant to what I said. Because tags name types, the fact that they are in the same namespace as other identifiers is most easily shown using typedefs, which are also in the ordinary name space. The following code is permitted in C, even though both declarations are in the same scope, because 'y' is declared in two different name spaces: typedef int y; struct y { int z;}; However, in C++ it is not permitted because both occurrences of 'y' are in the same name space. That's equally true whether they occur in the same named namespace or the same unnamed namespace.