This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12629] name leaks
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2003 19:11:21 -0000
- Subject: [Bug c++/12629] name leaks
- References: <20031015224509.12629.yujie.wu@hec.utah.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12629
------- Additional Comments From gdr at integrable-solutions dot net 2003-10-20 19:11 -------
Subject: Re: name leaks
Yujie Wu <yujie.wu@hec.utah.edu> writes:
| Thanks for your comments. In fact, it is a VALID C++ program accroding
| to the C++ standard: All C-library functions in C++ should be wrapped
| into `std' namespace rather than staying in the global namespace as in C.
The program is NOT valid. Here is why:
17.4.3.1.3/4
Each name from the Standard C library declared with external linkage
is reserved to the implementation for use with extern "C" linkage,
both in namespace std and in the global namespace.
| Whatever linkages those function have is the business of the compiler,
| which should deal it in the way the standard says (if it wants to be a
| compliant compiler).
The issue is not that simple. See above. The reason is that if a
function is declared as having a C linkage then *all* declarations of
the same function in *any* namespace refer to the *same function*.
Therefore your definition of ::exit is ill-formed.
-- Gaby