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]

Fixinclude patch for HP-UX


This patch deals with a bug in the HP-UX header files where the sendfile
and sendpath routines are declared extern and then static.  This only
happens when compiling with -D_FILE_OFFSET_BITS=64, so it doesn't come
up much and it has been fixed in the next release of the OS so this fix
is restricted to 11.11 and 11.2* HP-UX targets as those are the only
versions that have the bug.  I will check it on ToT unless there are
objections.

Mark, is this patch OK for the 4.2 branch?  It is HP-UX specific and it
is a regression in the sense that 3.* GCC's would give a warning on
"extern foo(); static foo() {}" while 4.* GCC's give an error and thus
make it impossible to compile the header.

Steve Ellcey
sje@cup.hp.com

2006-10-31  Steve Ellcey  <sje@cup.hp.com>

	* inclhack.def (hpux11_extern_sendfile): New.
	(hpux11_extern_sendpath): New.

Index: inclhack.def
===================================================================
--- inclhack.def	(revision 118218)
+++ inclhack.def	(working copy)
@@ -1781,6 +1781,26 @@ fix = {
 };
 
 fix = {
+    hackname  = hpux11_extern_sendfile;
+    mach      = "*-hp-hpux11.[12]*";
+    files     = sys/socket.h;
+    select    = "^[ \t]*extern sbsize_t sendfile.*\n.*, int\\)\\);\n";
+    c_fix     = format;
+    c_fix_arg = "#ifndef _APP32_64BIT_OFF_T\n%0#endif\n";
+    test_text = "   extern sbsize_t sendfile __((int, int, off_t, bsize_t,\n                               const struct iovec *, int));\n";
+};
+
+fix = {
+    hackname  = hpux11_extern_sendpath;
+    mach      = "*-hp-hpux11.[12]*";
+    files     = sys/socket.h;
+    select    = "^[ \t]*extern sbsize_t sendpath.*\n.*, int\\)\\);\n";
+    c_fix     = format;
+    c_fix_arg = "#ifndef _APP32_64BIT_OFF_T\n%0#endif\n";
+    test_text = "   extern sbsize_t sendpath __((int, int, off_t, bsize_t,\n                               const struct iovec *, int));\n";
+};
+
+fix = {
     hackname  = hpux_extern_errno;
     mach      = "*-hp-hpux10.*";
     mach      = "*-hp-hpux11.[0-2]*";


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