public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12629] New: name leaks
@ 2003-10-15 22:45 yujie dot wu at hec dot utah dot edu
  2003-10-15 22:49 ` [Bug c++/12629] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: yujie dot wu at hec dot utah dot edu @ 2003-10-15 22:45 UTC (permalink / raw)
  To: gcc-bugs

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 <csdtlib> is
included. But not.

Try the following program to reproduce the error:

#include <cstdlib>
#include <cstdio>
 
 
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 (<cstdlib>) and leaks into the global scope.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-20 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15 22:45 [Bug c++/12629] New: name leaks yujie dot wu at hec dot utah dot edu
2003-10-15 22:49 ` [Bug c++/12629] " pinskia at gcc dot gnu dot org
2003-10-18 12:27 ` gdr at integrable-solutions dot net
2003-10-20 19:21 ` gdr at integrable-solutions dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).