C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Confusion about toupper()

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Llewelly
Guest





PostPosted: Wed Apr 20, 2005 5:19 pm    Post subject: Re: Confusion about toupper() Reply with quote




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





PostPosted: Sun Apr 24, 2005 9:39 pm    Post subject: Re: Confusion about toupper() Reply with quote




"Llewelly" <llewelly.at (AT) xmission (DOT) dot.com> schrieb im Newsbeitrag
news:86sm1nwvta.fsf (AT) zorthluthik (DOT) foo.bar...
Quote:


[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





PostPosted: Mon Apr 25, 2005 6:15 am    Post subject: Re: Confusion about toupper() Reply with quote




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





PostPosted: Mon Apr 25, 2005 4:19 pm    Post subject: Re: Confusion about toupper() Reply with quote

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





PostPosted: Tue Apr 26, 2005 5:21 am    Post subject: Re: Confusion about toupper() Reply with quote

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





PostPosted: Tue Apr 26, 2005 2:52 pm    Post subject: Re: Confusion about toupper() Reply with quote


<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





PostPosted: Wed Apr 27, 2005 3:04 pm    Post subject: Re: Confusion about toupper() Reply with quote


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





PostPosted: Fri Apr 29, 2005 2:39 pm    Post subject: Re: Confusion about toupper() Reply with quote


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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.