This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fixinc for Solaris 2.5.1


> I may be wrong, but it shouldn't.  Such warnings should be disabled
> in the system headers.

Yep, it worked fine without the complete prototype.

> They flat out don't work on BSD.  If passing -b to diff fixes the problems
> you see, then please email me confirmation & we'll add it.  I don't think
> the BSD sed issue is fixable because it produces different results.

You're right, it's a little better but not much, I still get failures on 
spurious whitespaces. Probably not worth adding.

I hadn't bootstrapped with Java enabled the first time but I just did and saw 
the two failures reported by Arno, both on Solaris 2.5.1 and 2.6, so I added 
two other hacks.

Bootstrapped (all languages except Ada) on Sparc/Solaris 2.5.1 and 2.6.

[Arno, what's your complete name for the ChangeLog entry]

-- 
Eric Botcazou

2003-05-26  Eric Botcazou  <ebotcazou@libertysurf.fr>
                   Arno <arno@heho.snv.jussieu.fr>

        * fixinc/inclhack.def: Add missing declaration of getpagesize()
        to <unistd.h> on Solaris 2.5.1.
	Fix prototype of recv() and send() in <sys/socket.h> on
	Solaris 2.5.1 and 2.6.
        * fixinc/tests/base/unistd.h: Add solaris_unistd fix test.
	* fixinc/tests/base/sys/socket.h: Add solaris_socket_1 and
	solaris_socket_2 tests.
        * fixinc/check.tpl: Use 'diff -c', not 'diff -u'.
Index: fixinc/check.tpl
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/check.tpl,v
retrieving revision 1.18
diff -u -r1.18 check.tpl
--- fixinc/check.tpl	19 Apr 2003 21:10:07 -0000	1.18
+++ fixinc/check.tpl	26 May 2003 10:52:04 -0000
@@ -135,7 +135,7 @@
     :
 
   else
-    ${DIFF:-diff} -u $f ${TESTBASE}/$f >&2 || :
+    ${DIFF:-diff} -c $f ${TESTBASE}/$f >&2 || :
     exitok=false
   fi
 done
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.156
diff -u -r1.156 inclhack.def
--- fixinc/inclhack.def	22 May 2003 17:03:57 -0000	1.156
+++ fixinc/inclhack.def	26 May 2003 10:52:08 -0000
@@ -2199,6 +2199,36 @@
 };
 
 
+/* Solaris 2.5.1 and 2.6 use an outdated prototype for recv in sys/socket.h.
+ * This is corrected in Solaris 7 and up.
+ */
+fix = {
+    hackname = solaris_socket_1;
+    files = sys/socket.h;
+    select = '@\(#\)socket.h' "[ \t]+1.[123][0-9][ \t]+9[567]/[0-9/]+ SMI";
+    c_fix = format;
+    c_fix_arg = "extern int recv(int, void *, int, int);";
+    c_fix_arg = '^extern int recv\(int, char \*, int, int);.*';
+    test_text = '#ident   "@(#)socket.h   1.30    97/01/20 SMI"'"\n"
+                "extern int recv(int, char *, int, int);";
+};
+
+
+/* Solaris 2.5.1 and 2.6 use an outdated prototype for send in sys/socket.h.
+ * This is corrected in Solaris 7 and up.
+ */
+fix = {
+    hackname = solaris_socket_2;
+    files = sys/socket.h;
+    select = '@\(#\)socket.h' "[ \t]+1.[123][0-9][ \t]+9[567]/[0-9/]+ SMI";
+    c_fix = format;
+    c_fix_arg = "extern int send(int, const void *, int, int);";
+    c_fix_arg = '^extern int send\(int, const char \*, int, int\);.*';
+    test_text = '#ident   "@(#)socket.h   1.30    97/01/20 SMI"'"\n"
+                "extern int send(int, const char *, int, int);";
+};
+
+
 /*
  * Solaris 2.8 has what appears to be some gross workaround for 
  * some old version of their c++ compiler.  G++ doesn't want it
@@ -2213,6 +2243,25 @@
 
     test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)";
 };
+
+
+/*
+ * Sun Solaris 2.5.1 doesn't define 'getpagesize' in <unistd.h>, as is done
+ * on Solaris 2.6 and up.
+ */
+fix = {
+    hackname  = solaris_unistd;
+    files = unistd.h;
+    select = '@\(#\)unistd.h' "[ \t]+1.3[0-9][ \t]+9[567]/[0-9/]+ SMI";
+    bypass = "getpagesize";
+    c_fix = format;
+    c_fix_arg = "extern int getpagesize();\n%0";
+    c_fix_arg = '^extern (pid_t|int) getpgid\(.*\);.*';
+    test_text = '#ident "@(#)unistd.h   1.33    95/08/28 SMI"'"\n"
+                "extern pid_t getpgid(pid_t);\n"
+                "extern int getpgid();";
+};
+
 
 /*
  * <widec.h> until Solaris 2.5.1 defines macros for a couple of <wchar.h>
Index: fixinc/tests/base/unistd.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/tests/base/unistd.h,v
retrieving revision 1.2
diff -u -r1.2 unistd.h
--- fixinc/tests/base/unistd.h	19 Jul 2000 14:18:30 -0000	1.2
+++ fixinc/tests/base/unistd.h	26 May 2003 10:52:08 -0000
@@ -12,3 +12,12 @@
 #if defined( ALPHA_SBRK_CHECK )
 extern void *sbrk(ptrdiff_t increment);
 #endif  /* ALPHA_SBRK_CHECK */
+
+
+#if defined( SOLARIS_UNISTD_CHECK )
+#ident "@(#)unistd.h   1.33    95/08/28 SMI"
+extern int getpagesize();
+extern pid_t getpgid(pid_t);
+extern int getpagesize();
+extern int getpgid();
+#endif  /* SOLARIS_UNISTD_CHECK */
Index: fixinc/tests/base/sys/socket.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/tests/base/sys/socket.h,v
retrieving revision 1.1
diff -u -r1.1 socket.h
--- fixinc/tests/base/sys/socket.h	19 Feb 2003 16:39:05 -0000	1.1
+++ fixinc/tests/base/sys/socket.h	26 May 2003 10:52:08 -0000
@@ -17,3 +17,15 @@
 typedef u_int32_t socklen_t;
 #endif /* _NO_XOPEN4 && _NO_XOPEN5 */
 #endif  /* IRIX_SOCKLEN_T_CHECK */
+
+
+#if defined( SOLARIS_SOCKET_1_CHECK )
+#ident   "@(#)socket.h   1.30    97/01/20 SMI"
+extern int recv(int, void *, int, int);
+#endif  /* SOLARIS_SOCKET_1_CHECK */
+
+
+#if defined( SOLARIS_SOCKET_2_CHECK )
+#ident   "@(#)socket.h   1.30    97/01/20 SMI"
+extern int send(int, const void *, int, int);
+#endif  /* SOLARIS_SOCKET_2_CHECK */

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