This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: fixinc/inclhack.def patch for string.h skipped memcpy and memcmp in libc1
- To: gcc-patches at gcc dot gnu dot org
- Subject: RFA: fixinc/inclhack.def patch for string.h skipped memcpy and memcmp in libc1
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Tue, 4 Jul 2000 18:32:21 +0200
It seems g++ now barfs on implicit declarations, including builtins.
A missing memcpy, or really; skipped declaration in string.h is fatal.
See the test_text in the patch for what is in my RH 4.2 (gasp!)
/usr/include/string.h. Bootstrap fails on this i686-pc-linux-gnulibc1
system. There's a similarly "skipped" declaration for memcmp.
I naively suggest mapping those into the following fixinc fix, removing
the bogus #if-construct. Other suggestions for solutions (except
upgrading :-) are welcome.
Bootstrapped on i686-pc-linux-gnulibc1, languages=c,c++ (with other
previously sent patches to config.guess and timevar.c).
Ok to commit?
2000-07-04 Hans-Peter Nilsson <hp@axis.com>
* fixinc/inclhack.def (libc1_ifdefd_memx): New fix.
* fixinc/fixincl.x: Regenerate.
Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.80
diff -p -c -r1.80 inclhack.def
*** inclhack.def 2000/06/17 19:42:47 1.80
--- inclhack.def 2000/07/04 13:37:59
*************** fix = {
*** 1294,1299 ****
--- 1294,1330 ----
};
+ /* GNU libc1 string.h does not prototype memcpy and memcmp for gcc
+ versions > 1. */
+ fix = {
+ hackname = libc1_ifdefd_memx;
+ files = string.h;
+ c_fix = format;
+ select = "' is a built-in function for gcc 2\\.x\\. \\*/";
+ bypass = __cplusplus;
+ c_fix_arg = "%1\n%2\n%3";
+ c_fix_arg = "/\\* `mem...' is a built-in function for gcc 2\\.x\\. \\*/\n"
+ "#if defined\\(__STDC__\\) && __GNUC__ < 2\n"
+ "(/\\* .* \\*/)\n"
+ "(extern [a-z_]+ mem.*)\n"
+ "([ \t][^\n]+)\n"
+ "#endif";
+
+ #if 0
+ /* The string.h result is overwritten by AAB_ultrix_string when doing
+ "make check" and will fail. It is kept here for reference: wrap
+ AAB_ultrix_string in #if 0 and add the expected string.h result
+ when testing this fix. */
+ test_text = "/* \\`memcpy\' is a built-in function for gcc 2.x. */\n"
+ "#if defined(__STDC__) && __GNUC__ < 2\n"
+ "/* Copy N bytes of SRC to DEST. */\n"
+ "extern __ptr_t memcpy __P ((__ptr_t __dest, __const __ptr_t __src,\n"
+ " size_t __n));\n"
+ "#endif";
+ #endif
+ };
+
+
/*
* In limits.h, put #ifndefs around things that are supposed to be defined
* in float.h to avoid redefinition errors if float.h is included first.
brgds, H-P