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]

[committed 3.4/3.5] New include hacks for hppa*-hp-hpux10* and vax-dec-ultrix*


The following include hacks are necessary for building GCC on hppa*-hp-hpux10*
and vax-dec-ultrix* when -Werror is not disabled.  The hacks mainly add
missing declarations.

Tested with a full bootstrap and check on hppa1.1-hp-hpux10.20, and a
C bootstrap and check on vax-dec-ultrix4.3.  The fixed headers were
visually inspected to see that the expected fixes were present.  Make
check in the gcc/fixinc directory passes with no failures.

Installed to 3.4 and trunk.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2004-01-21  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* fixinc/inclhack.def (hpux10_stdio_declarations, ultrix_const3,
	ultrix_locale, ultrix_stdlib, ultrix_strings, ultrix_sys_time,
	ultrix_unistd): New hacks.
	* fixinc/tests/base/stdio.h (HPUX10_STDIO_DECLARATIONS_CHECK,
	ULTRIX_CONST2_CHECK): Add checks.
	* fixinc/tests/base/stdlib.h (ULTRIX_STDLIB_CHECK): Likewise.
	* fixinc/tests/base/strings.h (ULTRIX_STRINGS2_CHECK): Likewise.
	* fixinc/tests/base/unistd.h (ULTRIX_UNISTD_CHECK): Likewise.
	* fixinc/tests/base/sys/time.h (ULTRIX_SYS_TIME_CHECK): Likewise.
	* fixinc/tests/base/locale.h: New file.
	* fixinc/fixincl.x: Rebuilt.

Index: fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.191
diff -u -3 -p -r1.191 inclhack.def
--- fixinc/inclhack.def	16 Jan 2004 20:58:24 -0000	1.191
+++ fixinc/inclhack.def	21 Jan 2004 18:53:49 -0000
@@ -1246,6 +1246,28 @@ fix = {
 
 
 /*
+ *  Fix hpux 10.X missing stdio declarations
+ */
+fix = {
+    hackname = hpux10_stdio_declarations;
+    files    = stdio.h;
+    select   = "^#[ \t]*define _iob[ \t]*__iob";
+    bypass   = "^[ \t]*extern[ \t]*int[ \t]*vsnprintf[ \t]*\\(";
+    c_fix     = format;
+    c_fix_arg = "%0\n\n"
+	"#  if defined(__STDC__) || defined(__cplusplus)\n"
+	"     extern int snprintf(char *, size_t, const char *, ...);\n"
+	"     extern int vsnprintf(char *, size_t, const char *, __va_list);\n"
+	"#  else /* not __STDC__) || __cplusplus */\n"
+	"     extern int snprintf();\n"
+	"     extern int vsnprintf();\n"
+	"#  endif /* __STDC__) || __cplusplus */\n";
+
+    test_text = "#  define _iob __iob\n";
+};
+
+
+/*
  *  Make sure hpux defines abs in header.
  */
 fix = {
@@ -3440,6 +3462,24 @@ fix = {
 
 
 /*
+ *  parameters not const on Ultrix V4.3.
+ */
+fix = {
+    hackname  = ultrix_const3;
+    files     = stdio.h;
+    select    = 'fdopen\( .*, char \*';
+
+    c_fix     = format;
+    c_fix_arg = "%1 const %3 *__";
+    c_fix_arg = "([ \t*](fdopen)\\(.*)"
+                "[ \t]+(char|void) \\*__";
+
+    test_text =
+    "extern FILE *	fdopen( int __filedes, char *__type );\n";
+};
+
+
+/*
  * Ultrix V4.[35] puts the declaration of uname before the definition
  * of struct utsname, so the prototype (added by fixproto) causes havoc.
  */
@@ -3474,6 +3514,19 @@ fix = {
 
 
 /*
+ *  Add once-only latch to Ultrix V4.3 locale.h.
+ */
+fix = {
+    hackname = ultrix_locale;
+    files  = locale.h;
+    select = "@\\(#\\)locale\\.h.*6\\.1.*\\(ULTRIX\\)";
+    c_fix  = wrap;
+    test_text =
+    "@(#)locale.h   6.1     (ULTRIX)\n";
+};
+
+
+/*
  * Strip "|| CC$gfloat" from Ultrix math headers.
  */
 fix = {
@@ -3553,6 +3606,31 @@ fix = {
 
 
 /*
+ *  Add missing declarations to Ultrix V4.3 stdlib.h.
+ */
+fix = {
+    hackname = ultrix_stdlib;
+    files  = stdlib.h;
+    select = "@\\(#\\)stdlib\\.h.*6\\.1.*\\(ULTRIX\\)";
+
+    sed    = "/^char.*getenv( const char .* );.*$/a\\\n"
+    "int\t\tsetenv( const char *__name, const char *__val, int __ovrwrt );\\\n"
+    "void\t\tunsetenv( const char *__name );\\\n"
+    "int\t\tputenv( char *__s );\n";
+
+    sed    = "/^char.*getenv();.*$/a\\\n"
+    "int\tsetenv();\\\n"
+    "void\tunsetenv();\\\n"
+    "int\tputenv();\n";
+
+    test_text =
+    "@(#)stdlib.h      6.1     (ULTRIX)\n"
+    "char *		getenv( const char *__name );\n"
+    "char	*getenv();\n";
+};
+
+
+/*
  *  Add once-only latch to Ultrix V4.3 strings.h.
  */
 fix = {
@@ -3562,6 +3640,91 @@ fix = {
     c_fix  = wrap;
     test_text =
     "@(#)strings.h   6.1     (ULTRIX)\n";
+};
+
+
+/*
+ *  Add missing declarations to Ultrix V4.3 strings.h.
+ */
+fix = {
+    hackname = ultrix_strings2;
+    files  = strings.h;
+    select = "@\\(#\\)strings\\.h.*6\\.1.*\\(ULTRIX\\)";
+
+    sed    = "/^.*strncmp( const .* );.*/a\\\n"
+    "\\\n"
+    "extern int\\\n"
+    "\tstrcasecmp( const char *__s1, const char *__s2),\\\n"
+    "\tstrncasecmp( const char *__s1, const char *__s2, size_t __n );\n";
+
+    sed    = "/^.*strncmp();.*/a\\\n"
+    "extern int\\\n"
+    "\tstrcasecmp(),\\\n"
+    "\tstrncasecmp();\n";
+
+    test_text =
+    "@(#)strings.h      6.1     (ULTRIX)\n"
+    "\tstrncmp( const char *__s1, const char *__s2, size_t __n );\n"
+    "\tstrncmp();\n";
+};
+
+
+/*
+ *  Add missing declarations to Ultrix V4.3 sys/time.h.
+ */
+fix = {
+    hackname = ultrix_sys_time;
+    files  = sys/time.h;
+    select = "@\\(#\\)time\\.h.*6\\.1.*\\(ULTRIX\\)";
+
+    sed    = "/^extern.*time_t.*time( time_t .* );.*$/a\\\n"
+    "\\\n"
+    "extern int adjtime(struct timeval *, struct timeval *);\\\n"
+    "extern int getitimer(int, struct itimerval *);\\\n"
+    "extern int setitimer(int, struct itimerval *, struct itimerval *);\\\n"
+    "extern int gettimeofday(struct timeval *, struct timezone *);\\\n"
+    "extern int settimeofday(struct timeval *, struct timezone *);\\\n"
+    "extern void profil(const void *, size_t, size_t, unsigned int);\\\n"
+    "extern int stime(const time_t *);\\\n"
+    "extern int utimes(const char *, const struct timeval[2]);\\\n"
+    "extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);\n";
+
+    sed    = "/^extern.*double.*difftime();.*$/a\\\n"
+    "extern\tint adjtime();\\\n"
+    "extern\tint getitimer();\\\n"
+    "extern\tint setitimer();\\\n"
+    "extern\tint gettimeofday();\\\n"
+    "extern\tint settimeofday();\\\n"
+    "extern\tvoid profil();\\\n"
+    "extern\tint stime();\\\n"
+    "extern\tint utimes();\\\n"
+    "extern\tint select();\n";
+
+    test_text =
+    "@(#)time.h      6.1     (ULTRIX)\n"
+    "extern time_t		time( time_t *__tloc );\n"
+    "extern double difftime();\n";
+};
+
+
+/*
+ *  Add missing declarations to Ultrix V4.3 unistd.h.
+ */
+fix = {
+    hackname = ultrix_unistd;
+    files  = unistd.h;
+    select = "@\\(#\\)unistd\\.h.*6\\.1.*\\(ULTRIX\\)";
+
+    sed    = "/^[ \t]*getgroups(),.*$/a\\\n"
+    "\tgetpagesize(),\n";
+
+    sed    = "/^[ \t]*fork(),.*$/a\\\n"
+    "\tvfork(),\n";
+
+    test_text =
+    "@(#)unistd.h      6.1     (ULTRIX)\n"
+    "\tgetgroups(),\n"
+    "\tfork(),\n";
 };
 
 
Index: fixinc/tests/base/stdio.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/tests/base/stdio.h,v
retrieving revision 1.12
diff -u -3 -p -r1.12 stdio.h
--- fixinc/tests/base/stdio.h	25 Oct 2003 18:45:39 -0000	1.12
+++ fixinc/tests/base/stdio.h	21 Jan 2004 18:53:50 -0000
@@ -26,6 +26,12 @@ int vfscanf(FILE *, const char *, __buil
 #endif  /* BSD_STDIO_ATTRS_CONFLICT_CHECK */
 
 
+#if defined( HPUX10_STDIO_DECLARATIONS_CHECK )
+#  define _iob __iob
+
+#endif  /* HPUX10_STDIO_DECLARATIONS_CHECK */
+
+
 #if defined( HPUX11_SNPRINTF_CHECK )
 extern int snprintf(char *, size_t, const char *, ...);
 extern int snprintf(char *, _hpux_size_t, const char *, ...);
@@ -88,6 +94,12 @@ extern FILE *popen( const char *, const 
 extern char *tempnam( const char *, const char *);
 
 #endif  /* ULTRIX_CONST2_CHECK */
+
+
+#if defined( ULTRIX_CONST3_CHECK )
+extern FILE *	fdopen( int __filedes, const char *__type );
+
+#endif  /* ULTRIX_CONST3_CHECK */
 
 
 #if defined( UNICOSMK_RESTRICT_CHECK )
Index: fixinc/tests/base/stdlib.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/tests/base/stdlib.h,v
retrieving revision 1.6
diff -u -3 -p -r1.6 stdlib.h
--- fixinc/tests/base/stdlib.h	11 Feb 2003 20:43:41 -0000	1.6
+++ fixinc/tests/base/stdlib.h	21 Jan 2004 18:53:50 -0000
@@ -50,3 +50,17 @@ extern void *	bsearch(void*,size_t,size_
 int atexit( void (*__func)( void ) );
 
 #endif  /* ULTRIX_ATEXIT_PARAM_CHECK */
+
+
+#if defined( ULTRIX_STDLIB_CHECK )
+@(#)stdlib.h      6.1     (ULTRIX)
+char *		getenv( const char *__name );
+int		setenv( const char *__name, const char *__val, int __ovrwrt );
+void		unsetenv( const char *__name );
+int		putenv( char *__s );
+char	*getenv();
+int	setenv();
+void	unsetenv();
+int	putenv();
+
+#endif  /* ULTRIX_STDLIB_CHECK */
Index: fixinc/tests/base/strings.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/tests/base/strings.h,v
retrieving revision 1.4
diff -u -3 -p -r1.4 strings.h
--- fixinc/tests/base/strings.h	4 Jan 2003 21:14:54 -0000	1.4
+++ fixinc/tests/base/strings.h	21 Jan 2004 18:53:50 -0000
@@ -22,4 +22,19 @@
 
 #endif  /* ULTRIX_STRINGS_CHECK */
 
+
+#if defined( ULTRIX_STRINGS2_CHECK )
+@(#)strings.h      6.1     (ULTRIX)
+	strncmp( const char *__s1, const char *__s2, size_t __n );
+
+extern int
+	strcasecmp( const char *__s1, const char *__s2),
+	strncasecmp( const char *__s1, const char *__s2, size_t __n );
+	strncmp();
+extern int
+	strcasecmp(),
+	strncasecmp();
+
+#endif  /* ULTRIX_STRINGS2_CHECK */
+
 #endif  /* FIXINC_WRAP_STRINGS_H_ULTRIX_STRINGS */
Index: fixinc/tests/base/unistd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/tests/base/unistd.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 unistd.h
--- fixinc/tests/base/unistd.h	28 May 2003 11:53:34 -0000	1.3
+++ fixinc/tests/base/unistd.h	21 Jan 2004 18:53:50 -0000
@@ -21,3 +21,13 @@ extern pid_t getpgid(pid_t);
 extern int getpagesize();
 extern int getpgid();
 #endif  /* SOLARIS_UNISTD_CHECK */
+
+
+#if defined( ULTRIX_UNISTD_CHECK )
+@(#)unistd.h      6.1     (ULTRIX)
+	getgroups(),
+	getpagesize(),
+	fork(),
+	vfork(),
+
+#endif  /* ULTRIX_UNISTD_CHECK */
Index: fixinc/tests/base/sys/time.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/tests/base/sys/time.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 time.h
--- fixinc/tests/base/sys/time.h	19 Jul 2000 14:18:31 -0000	1.2
+++ fixinc/tests/base/sys/time.h	21 Jan 2004 18:53:51 -0000
@@ -12,3 +12,30 @@
 #if defined( HPUX_SYSTIME_CHECK )
 struct sigevent;
 #endif  /* HPUX_SYSTIME_CHECK */
+
+
+#if defined( ULTRIX_SYS_TIME_CHECK )
+@(#)time.h      6.1     (ULTRIX)
+extern time_t		time( time_t *__tloc );
+
+extern int adjtime(struct timeval *, struct timeval *);
+extern int getitimer(int, struct itimerval *);
+extern int setitimer(int, struct itimerval *, struct itimerval *);
+extern int gettimeofday(struct timeval *, struct timezone *);
+extern int settimeofday(struct timeval *, struct timezone *);
+extern void profil(const void *, size_t, size_t, unsigned int);
+extern int stime(const time_t *);
+extern int utimes(const char *, const struct timeval[2]);
+extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+extern double difftime();
+extern	int adjtime();
+extern	int getitimer();
+extern	int setitimer();
+extern	int gettimeofday();
+extern	int settimeofday();
+extern	void profil();
+extern	int stime();
+extern	int utimes();
+extern	int select();
+
+#endif  /* ULTRIX_SYS_TIME_CHECK */
--- /dev/null	Wed Jan 21 13:51:25 2004
+++ fixinc/tests/base/locale.h	Wed Jan 21 13:50:27 2004
@@ -0,0 +1,20 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/locale.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+#ifndef FIXINC_WRAP_LOCALE_H_ULTRIX_LOCALE
+#define FIXINC_WRAP_LOCALE_H_ULTRIX_LOCALE 1
+
+
+
+#if defined( ULTRIX_LOCALE_CHECK )
+@(#)locale.h   6.1     (ULTRIX)
+
+#endif  /* ULTRIX_LOCALE_CHECK */
+
+#endif  /* FIXINC_WRAP_LOCALE_H_ULTRIX_LOCALE */


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