 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Llewelly Guest
|
Posted: Wed Apr 20, 2005 5:19 pm Post subject: Re: Confusion about toupper() |
|
|
Pete Becker <petebecker (AT) acm (DOT) org> writes:
| Quote: | Matthias Hofmann wrote:
I am a little confused about toupper(). The way I interpret the standard,
including the header <cctype> should make toupper() available within
namespace std, and only within namespace std.
That's what the standard says. It's often not reasonable to implement.
There's an active defect report that's designed to relax this
requirement to match common behavior.
[snip] |
What about 17.4.3.1.3/5:
# Each function signature from the Standard C library declared
# with external linkage is reserved to the implementation for use
# as a function signature with both extern "C" and extern "C++"
# linkage,168) or as a name of namespace scope in the global
# namespace.
In the past I've interpreted this as granting library implementators
permission provide a function definition for names such as
::toupper(), regardless of whether <cxxx> or <xxx.h> was included
at all. Yet I can't imagine someone opening issue 456 if that was
the case. So I don't understand it at all, it seems.
What does 17.4.3.1.3/5 mean?
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Matthias Hofmann Guest
|
Posted: Sun Apr 24, 2005 9:39 pm Post subject: Re: Confusion about toupper() |
|
|
"Llewelly" <llewelly.at (AT) xmission (DOT) dot.com> schrieb im Newsbeitrag
news:86sm1nwvta.fsf (AT) zorthluthik (DOT) foo.bar...
[snip]
| Quote: |
What about 17.4.3.1.3/5:
# Each function signature from the Standard C library declared
# with external linkage is reserved to the implementation for use
# as a function signature with both extern "C" and extern "C++"
# linkage,168) or as a name of namespace scope in the global
# namespace.
In the past I've interpreted this as granting library implementators
permission provide a function definition for names such as
::toupper(), regardless of whether <cxxx> or <xxx.h> was included
at all. Yet I can't imagine someone opening issue 456 if that was
the case. So I don't understand it at all, it seems.
What does 17.4.3.1.3/5 mean?
|
I would be glad if someone could clarify this for me, too. I got no idea
what a "name of namespace scope in the gloabal namespace" is supposed to
mean, which makes it even harder for me to understand. How can a name of
namespace scope be in the global namespace?
--
Matthias Hofmann
Anvil-Soft, CEO
http://www.anvil-soft.com - The Creators of Klomanager
http://www.anvil-soft.de - Die Macher des Klomanagers
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
kuyper@wizard.net Guest
|
Posted: Mon Apr 25, 2005 6:15 am Post subject: Re: Confusion about toupper() |
|
|
Matthias Hofmann wrote:
| Quote: | "Llewelly" <llewelly.at (AT) xmission (DOT) dot.com> schrieb im Newsbeitrag
news:86sm1nwvta.fsf (AT) zorthluthik (DOT) foo.bar...
...
I would be glad if someone could clarify this for me, too. I got no
idea
what a "name of namespace scope in the gloabal namespace" is supposed
to
mean, which makes it even harder for me to understand. How can a name
of
namespace scope be in the global namespace?
|
The global namespace is, as it's name implies, a namespace. Therefore,
when a declaration has namespace scope, and it's not inside any other
namespace, then the namespace that defines it's scope is the global
namespace.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Llewelly Guest
|
Posted: Mon Apr 25, 2005 4:19 pm Post subject: Re: Confusion about toupper() |
|
|
Matthias Hofmann <hofmann (AT) anvil-soft (DOT) com> writes:
| Quote: | "Llewelly" <llewelly.at (AT) xmission (DOT) dot.com> schrieb im Newsbeitrag
news:86sm1nwvta.fsf (AT) zorthluthik (DOT) foo.bar...
[snip]
What about 17.4.3.1.3/5:
# Each function signature from the Standard C library declared
# with external linkage is reserved to the implementation for use
# as a function signature with both extern "C" and extern "C++"
# linkage,168) or as a name of namespace scope in the global
# namespace.
In the past I've interpreted this as granting library implementators
permission provide a function definition for names such as
::toupper(), regardless of whether <cxxx> or <xxx.h> was included
at all. Yet I can't imagine someone opening issue 456 if that was
the case. So I don't understand it at all, it seems.
What does 17.4.3.1.3/5 mean?
I would be glad if someone could clarify this for me, too. I got no idea
what a "name of namespace scope in the gloabal namespace" is supposed to
mean, which makes it even harder for me to understand. How can a name of
namespace scope be in the global namespace?
|
I don't think this clears up the issue of whether or not 17.4..3.1.3/5
allows library implementators to leave C library names in the
global namespace, but it seems to me what 'name of namespace scope
in the global namespace' is supposed to mean is cleared up by
3.3.5/3 :
# The outermost declarative region of a translation unit is also a
# namespace, called the global namespace. A name declared in the
# global namespace 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 with global namespace
# scope are said to be global.
The global scope is a namespace, though an implicit one, and the
phrase you question is thus not the contradiction it might
otherwise seem.
---
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Alberto Barbati Guest
|
Posted: Tue Apr 26, 2005 5:21 am Post subject: Re: Confusion about toupper() |
|
|
Matthias Hofmann wrote:
| Quote: |
I would be glad if someone could clarify this for me, too. I got no idea
what a "name of namespace scope in the global namespace" is supposed to
mean, which makes it even harder for me to understand. How can a name of
namespace scope be in the global namespace?
|
§3.3.5/3: "The outermost declarative region of a translation unit is
also a namespace, called the global namespace. A name declared in the
global namespace has global namespace scope (also called global scope).
[...]"
That said, the sentence "name of namespace scope in the global
namespace" has a clear and unambiguous meaning to me. Sure, one may
wonder why such wording was chosen over the less redundant and
equivalent "name of global namespace scope", but I don't think it
deserves a DR for just that.
Alberto
---
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Matthias Hofmann Guest
|
Posted: Tue Apr 26, 2005 2:52 pm Post subject: Re: Confusion about toupper() |
|
|
<kuyper (AT) wizard (DOT) net> schrieb im Newsbeitrag
news:1114387759.297461.266510 (AT) o13g2000cwo (DOT) googlegroups.com...
| Quote: | The global namespace is, as it's name implies, a namespace. Therefore,
when a declaration has namespace scope, and it's not inside any other
namespace, then the namespace that defines it's scope is the global
namespace.
|
I see. But when does a name or declaration have namespace scope? In other
words, is it possible for a name to be available in the global namespace
without having namespace scope?
--
Matthias Hofmann
Anvil-Soft, CEO
http://www.anvil-soft.com - The Creators of Klomanager
http://www.anvil-soft.de - Die Macher des Klomanagers
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Llewelly Guest
|
Posted: Wed Apr 27, 2005 3:04 pm Post subject: Re: Confusion about toupper() |
|
|
Matthias Hofmann <hofmann (AT) anvil-soft (DOT) com> writes:
| Quote: | kuyper (AT) wizard (DOT) net> schrieb im Newsbeitrag
news:1114387759.297461.266510 (AT) o13g2000cwo (DOT) googlegroups.com...
The global namespace is, as it's name implies, a namespace. Therefore,
when a declaration has namespace scope, and it's not inside any other
namespace, then the namespace that defines it's scope is the global
namespace.
I see. But when does a name or declaration have namespace scope? In other
words, is it possible for a name to be available in the global namespace
without having namespace scope?
|
I really doubt that's possible. If you're interested, the relevant std
sections are 3.3 and 3.4 .
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Allan W Guest
|
Posted: Fri Apr 29, 2005 2:39 pm Post subject: Re: Confusion about toupper() |
|
|
| Quote: | Matthias Hofmann <hofmann (AT) anvil-soft (DOT) com> writes:
I see. But when does a name or declaration have namespace scope? In
other
words, is it possible for a name to be available in the global
namespace
without having namespace scope?
|
Llewelly wrote:
| Quote: | I really doubt that's possible. If you're interested, the relevant
std
sections are 3.3 and 3.4 .
|
It's possible. Macro names are available in the global namespace -- and
all
other namespaces. (That's why they're considered evil.)
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|