From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23697 invoked by alias); 15 Oct 2003 22:45:14 -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 23677 invoked by uid 48); 15 Oct 2003 22:45:13 -0000 Date: Wed, 15 Oct 2003 22:45:00 -0000 From: "yujie dot wu at hec dot utah dot edu" To: gcc-bugs@gcc.gnu.org Message-ID: <20031015224509.12629.yujie.wu@hec.utah.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/12629] New: name leaks X-Bugzilla-Reason: CC X-SW-Source: 2003-10/txt/msg01101.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 Summary: name leaks Product: gcc Version: 3.4 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yujie dot wu at hec dot utah dot edu CC: gcc-bugs at gcc dot gnu dot org The function name `exit' should stay in std namespace when is included. But not. Try the following program to reproduce the error: #include #include void exit( int a = 0 ) { std::puts( "dddddddd" ); std::exit( a ); } int main() { exit( 1 ); } Correct program should print "ddddddddd" once. Erroneous program prints many times because the statement "std::exit" actually calls the `exit' defined in the global scope. The problem exists in both 3.3.x and 3.4 snapshots. Another name leak is `random' (only found on cygwin). This name seems to have been used by gcc somewhere () and leaks into the global scope.