gcc builtin functions, e.g. memcpy, and namespace std

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Thu May 18 14:19:00 GMT 2000


> I have two suggestions:
> 
> 1. Disable these builtins for C++, since they can be defined as
> inlines in the headers anyway, by making -fno-builtin default for C++
> 2. Put them in namespace std:: when compiling C++, so they work just
> as for C - silently being used instead of the library version where
> possible
> 
> The third alternative, which is to force users to specify ::memcpy or
> std::memcpy is not pleasant.

IMO, the fourth alternative is right:

4. Treat ::memcpy and std::memcpy identical, as any extern "C"
   function with a certain name should be the same function, regardless
   in which namespace they are defined.

Regards,
Martin



More information about the Libstdc++ mailing list