This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
fix 'strcpy' prototype
- To: libstdc++ at sources dot redhat dot com
- Subject: fix 'strcpy' prototype
- From: Raja R Harinath <harinath at cs dot umn dot edu>
- Date: 31 Oct 2000 19:53:50 -0600
Hi,
With --enable-cshadow-headers, g++ sometimes complains about
std::strcpy not agreeing with its internal prototype. Here's a
fix:
from Raja R Harinath <harinath@cs.umn.edu>
* include/c_std/bits/std_cstring.h (_CPP_strcpy_capture):
Return type is char *.
(strcpy): Likewise.
Index: include/c_std/bits/std_cstring.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/c_std/bits/std_cstring.h,v
retrieving revision 1.2
diff -u -p -u -r1.2 std_cstring.h
--- std_cstring.h 2000/10/12 12:45:58 1.2
+++ std_cstring.h 2000/11/01 01:52:18
@@ -58,7 +58,7 @@ namespace _C_legacy {
_CPP_memmove_capture(void* __s1, void const* __s2, size_t __n)
{ return memmove(__s1, __s2, __n); }
- inline void*
+ inline char*
_CPP_strcpy_capture(char* __s1, char const* __s2)
{ return strcpy(__s1, __s2); }
@@ -173,7 +173,7 @@ namespace std {
memmove(void* __s1, void const* __s2, size_t __n)
{ return _C_legacy::_CPP_memmove_capture(__s1, __s2, __n); }
- inline void*
+ inline char*
strcpy(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcpy_capture(__s1, __s2); }
- Hari
--
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions." -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing." -- Roy L Ash