This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fixincludes: fixing bsearch return type on sunos4, char* -> void*
- To: fixincludes at autogen dot freeservers dot com
- Subject: fixincludes: fixing bsearch return type on sunos4, char* -> void*
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Mon, 2 Aug 1999 13:43:53 -0400 (EDT)
- Cc: egcs-patches at egcs dot cygnus dot com
This patch fixes the return type of bsearch on sunos4 from
char* to void*. (Same as is done with malloc et al.)
Okay to install?
Thanks,
--Kaveh
PS: Its simple enough that perhaps the 2.95.1 branch could get this too?
1999-08-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fixincludes: Fix the return type of bsearch, char* -> void*.
* fixinc/inclhack.def: Likewise.
diff -rup orig/egcs-CVS19990802/gcc/fixincludes egcs-CVS19990802/gcc/fixincludes
--- orig/egcs-CVS19990802/gcc/fixincludes Thu Jun 17 22:25:21 1999
+++ egcs-CVS19990802/gcc/fixincludes Mon Aug 2 09:52:13 1999
@@ -1002,6 +1002,7 @@ if [ -r ${LIB}/$file ]; then
-e 's/char[ ]*\*[ ]*calloc/void \* calloc/g' \
-e 's/char[ ]*\*[ ]*malloc/void \* malloc/g' \
-e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \
+ -e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \
-e 's/int[ ][ ]*exit/void exit/g' \
-e "/$size_t_pattern/"'i\
#ifndef _GCC_SIZE_T\
diff -rup orig/egcs-CVS19990802/gcc/fixinc/inclhack.def egcs-CVS19990802/gcc/fixinc/inclhack.def
--- orig/egcs-CVS19990802/gcc/fixinc/inclhack.def Tue Jul 6 15:50:08 1999
+++ egcs-CVS19990802/gcc/fixinc/inclhack.def Mon Aug 2 09:58:47 1999
@@ -2083,6 +2083,7 @@ fix = {
sed = "s/char[ \t]*\\*[ \t]*calloc/void \\*\tcalloc/g";
sed = "s/char[ \t]*\\*[ \t]*malloc/void \\*\tmalloc/g";
sed = "s/char[ \t]*\\*[ \t]*realloc/void \\*\trealloc/g";
+ sed = "s/char[ \t]*\\*[ \t]*bsearch/void \\*\tbsearch/g";
sed = "s/int[ \t][ \t]*exit/void\texit/g";
sed = "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/i\\\n"
Here are the autogen'ed file changes:
diff -rup orig/egcs-CVS19990802/gcc/fixinc/fixincl.sh egcs-CVS19990802/gcc/fixinc/fixincl.sh
--- orig/egcs-CVS19990802/gcc/fixinc/fixincl.sh Mon Aug 2 09:10:15 1999
+++ egcs-CVS19990802/gcc/fixinc/fixincl.sh Mon Aug 2 09:58:48 1999
@@ -6,7 +6,7 @@
# files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search.
#
-# This script contains 104 fixup scripts.
+# This script contains 105 fixup scripts.
#
# See README-fixinc for more information.
#
diff -rup orig/egcs-CVS19990802/gcc/fixinc/fixincl.x egcs-CVS19990802/gcc/fixinc/fixincl.x
--- orig/egcs-CVS19990802/gcc/fixinc/fixincl.x Mon Aug 2 09:10:11 1999
+++ egcs-CVS19990802/gcc/fixinc/fixincl.x Mon Aug 2 09:58:48 1999
@@ -2946,6 +2946,7 @@ const char* apzSysz_Stdlib_For_SunPatch[
"-e", "s/char[ \t]*\\*[ \t]*calloc/void \\*\tcalloc/g",
"-e", "s/char[ \t]*\\*[ \t]*malloc/void \\*\tmalloc/g",
"-e", "s/char[ \t]*\\*[ \t]*realloc/void \\*\trealloc/g",
+ "-e", "s/char[ \t]*\\*[ \t]*bsearch/void \\*\tbsearch/g",
"-e", "s/int[ \t][ \t]*exit/void\texit/g",
"-e", "/typedef[ \ta-zA-Z_]*[ \t]size_t[ \t]*;/i\\\n\
#ifndef _GCC_SIZE_T\\\n\
diff -rup orig/egcs-CVS19990802/gcc/fixinc/inclhack.sh egcs-CVS19990802/gcc/fixinc/inclhack.sh
--- orig/egcs-CVS19990802/gcc/fixinc/inclhack.sh Mon Aug 2 09:10:13 1999
+++ egcs-CVS19990802/gcc/fixinc/inclhack.sh Mon Aug 2 09:58:48 1999
@@ -2440,6 +2440,7 @@ extern unsigned int\
-e 's/char[ ]*\*[ ]*calloc/void \* calloc/g' \
-e 's/char[ ]*\*[ ]*malloc/void \* malloc/g' \
-e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \
+ -e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \
-e 's/int[ ][ ]*exit/void exit/g' \
-e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/i\
#ifndef _GCC_SIZE_T\