This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Overloading vs. string functions, etc.
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Overloading vs. string functions, etc.
- From: Andreas Jaeger <aj at suse dot de>
- Date: 24 May 2001 21:53:40 +0200
- Cc: libstdc++ at gcc dot gnu dot org
- References: <20010524112207W.mitchell@codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
> Continuing yesterady's discussion, as I finish up the patches, I get
> problems with code like:
>
> #include <cstring>
> using namespace std;
>
> void f(char *a, const char *b) {
> strcpy (a, b);
> }
>
> I mentioned yesterday to Jakub that this problem was already showing
> up with some functions. The problem is that we have two overloads
> with the same type in scope: the one provided by /usr/include/string.h
> in the global namespace, and the `std' version thereof.
>
> This is a pretty serious issue since a lot of people write code like
> this. What can we do before the release to solve this problem,
> without tackling the whole problem of conformant headers?
>
> How about `#define strcpy __glibcpp_strcpy' in std_cstring.h before
> including /usr/includ/string.h? I think that would do the trick.
> Thoughts?
Gaby, isn't this the same problem we had with fabs in <math.h>? I've
just asked you for guidance on gcc-patches.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj