c++/3893: libstdc++ scope problem appear with -fno-honor-std

scisim@astro.estec.esa.nl scisim@astro.estec.esa.nl
Tue Jul 31 04:36:00 GMT 2001


>Number:         3893
>Category:       c++
>Synopsis:       libstdc++ scope problem appear with -fno-honor-std
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 31 04:36:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     SciSim
>Release:        gcc version 3.0.1 20010728 (Debian prerelease)
>Organization:
>Environment:
# [default]
>Description:
Trying to compile old code, that is NOT using namespaces, without affecting the code itself.

Or is it my misconception about the use of this flag?

>How-To-Repeat:
$ cat > bug.cc
#include <iostream>
int main()
{
 cout << "Hello world!" << endl;
 return 0;
}

$ g++-3.0 -fno-honor-std bug.cc
In file included from /usr/include/g++-v3/bits/stl_algobase.h:73,
                 from /usr/include/g++-v3/bits/std_memory.h:49,
                 from /usr/include/g++-v3/bits/std_string.h:43,
                 from /usr/include/g++-v3/bits/localefwd.h:42,
                 from /usr/include/g++-v3/bits/std_ios.h:43,
                 from /usr/include/g++-v3/bits/std_ostream.h:39,
                 from /usr/include/g++-v3/bits/std_iostream.h:40,
                 from /usr/include/g++-v3/iostream:31,
                 from bug.cc:1:
/usr/include/g++-v3/bits/std_cstdlib.h:156: `llabs' is already declared in this scope
/usr/include/g++-v3/bits/std_cstdlib.h:158: `lldiv' is already declared in this scope
>Fix:
$ # quick & dirty workaround
$ cat  > fix.h
using namespace std;
$ g++-3.0 -include fix.h bug.cc 
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list