This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Overloading vs. string functions, etc.


>>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:

    Gabriel> That would work only if the host <string.h> doesn't
    Gabriel> protect strcpy declaration against macro expansion.

Do you mean with something like:

  #ifndef strcpy
  extern char * strcpy (...);
  #endif

?  Yes, that would be a problem.  Do you know of any hosts that do
that? 

Let's put it another way: can my suggestion make things worse?  We
already do `#define foo __glibcpp_foo' for *some* of the `str*'
functions, so doing the others shouldn't really make things any worse.

If there are hosts that do what you say, we could have os_defines.h
set __GLIBCPP_DO_NOT_HIDE_GLOBAL_NAMES or some such, and then not do
the redefinitions in that case.

On GNU/Linux (our most important target) this strategy works.

So, I'm inclined to go with this approach in std_cstring.h, which will
fix up things so that I can check in my builtins patch.  (I've
discovered several bugs in the V3 testsuite and some cases where the
library was preventing successful optimization as well, so that patch
will fix regressions *and* improve code generation.)

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]