libstdc++/2767
Peter Schmid
schmid@snake.iap.physik.tu-darmstadt.de
Fri May 25 19:56:00 GMT 2001
The following reply was made to PR libstdc++/2767; it has been noted by GNATS.
From: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
To: bkoz@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/2767
Date: Sat, 26 May 2001 05:46:31 +0200 (CEST)
Please close the bugreport and file a new one, if not someone else
did, for the following code te.C. I believe this code is reasonable
and the inclusion of both string.h and cstring.h
happens in known programming packages, e.g. confer root.
Hope this helps,
Peter Schmid
Source code te.C
#include<string.h>
#include<cstring>
using namespace std;
void f(const char *name)
{
strchr(name,'/');
}
g++ -v -c te.C
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77,objc
Thread model: posix
gcc version 3.0 20010525 (prerelease)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ te.C -D__GNUG__=3 -D_GNU_SOURCE -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase te.C -version -o /tmp/ccvvWzyB.s
GNU CPP version 3.0 20010525 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0 20010525 (prerelease) (i686-pc-linux-gnu)
compiled by GNU C version 3.0 20010525 (prerelease).
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/g++-v3
/usr/local/include/g++-v3/i686-pc-linux-gnu
/usr/local/include/g++-v3/backward
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/include
/usr/local/i686-pc-linux-gnu/include
/usr/include
End of search list.
te.C: In function `void f(const char*)':
te.C:7: call of overloaded `strchr(const char*&, char)' is ambiguous
/usr/include/string.h:155: candidates are: char* strchr(const char*, int)
/usr/local/include/g++-v3/bits/std_cstring.h:147: char*
std::strchr(char*, int) <near match>
/usr/local/include/g++-v3/bits/std_cstring.h:143: const char*
std::strchr(const char*, int)
More information about the Gcc-prs
mailing list