From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9468 invoked by alias); 20 Oct 2003 19:11:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 9450 invoked by alias); 20 Oct 2003 19:11:21 -0000 Date: Mon, 20 Oct 2003 19:21:00 -0000 Message-ID: <20031020191121.9449.qmail@sources.redhat.com> From: "gdr at integrable-solutions dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031015224509.12629.yujie.wu@hec.utah.edu> References: <20031015224509.12629.yujie.wu@hec.utah.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/12629] name leaks X-Bugzilla-Reason: CC X-SW-Source: 2003-10/txt/msg01646.txt.bz2 List-Id: 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 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