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: 3.4 PATCH: Fix IRIX 6.5 internal/stdio_core.h


Bruce Korb writes:

> Rainer Orth wrote:
> 
> > Fri Jun 13 18:04:29 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
> > 
> >         * fixinc/inclhack.def (stdio_va_list): Apply to IRIX 6.5
> >         <internal/stdio_core.h> too.
> >         (irix_stdio_va_list): Likewise.
> >         * fixinc/fixincl.x: Regenerate.
> 
> > Ok for mainline if it passes?
> 
> I'd put it on all active branches.
> The chances of there being very many improper fixes on
> files that happen to be named, ``internal/stdio_core.h''
> are reasonably slim. ;-) - Bruce

Testing revealed that a bit more is needed:

* <internal/wchar_core.h> used to get its definition of va_list from
  <internal/stdio_core.h>.  Since this is no longer true, the former needs
  to be changed to use __gnuc_va_list as well.

* <internal/stdio_core.h> has a static definition of snprintf that used
  va_list.  Those need to use __gnuc_va_list now.

With those additional changes, bootstrap completes on mips-sgi-irix6.5.
Testing took me some time since I observed many different testsuite
failures, and needed to verify that they are unrelated.

Ok for 3.3 branch and mainline now?  (The 3.3 version of the patch is
identical, except for the comment on the stdio_va_list fix, which isn't
present on the branch at all).

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Fri Jun 13 18:04:29 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	(irix_stdio_va_list): Apply to IRIX 6.5 <internal/stdio_core.h>
	too.
	* fixinc/inclhack.def (stdio_va_list): Apply to IRIX 6.5
	<internal/stdio_core.h> and <internal/wchar_core.h> too.
	* fixinc/fixincl.x: Regenerate.

Index: gcc/fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.157
diff -u -p -r1.157 inclhack.def
--- gcc/fixinc/inclhack.def	28 May 2003 11:53:34 -0000	1.157
+++ gcc/fixinc/inclhack.def	2 Jul 2003 00:54:04 -0000
@@ -1440,12 +1440,14 @@ fix = {
 };
 
 /*
- *  IRIX 5.x's stdio.h declares some functions that take a va_list as
+ *  IRIX 5.x's stdio.h and IRIX 6.5's internal/stdio_core.h declare
+ *  some functions that take a va_list as
  *  taking char *.  However, GCC uses void * for va_list, so
  *  calling vfprintf with a va_list fails in C++.  */
 fix = {
     hackname  = irix_stdio_va_list;
     files     = stdio.h;
+    files     = internal/stdio_core.h;
 
     select = '(printf\(.*), /\* va_list \*/ char \*';
     c_fix  = format;
@@ -2328,10 +2330,15 @@ fix = {
  *  presence of __gnuc_va_list, __DJ_va_list, or _G_va_list is taken
  *  to indicate that the header knows what it's doing -- under SUSv2,
  *  stdio.h is required to define va_list, and we shouldn't break that.
+ *  On IRIX 6.5, internal/wchar_core.h used to get its definition of
+ *  va_list from stdio.h.  Since this doesn't happen any longer, use
+ *  __gnuc_va_list there, too.
  */
 fix = {
     hackname = stdio_va_list;
     files    = stdio.h;
+    files    = internal/stdio_core.h;
+    files    = internal/wchar_core.h;
     bypass   = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list';
 
     /*
@@ -2345,6 +2352,8 @@ fix = {
      */
     sed = "s@ va_list @ __gnuc_va_list @\n"
           "s@ va_list)@ __gnuc_va_list)@\n"
+    	  "s@va_list _ap;@__gnuc_va_list _ap;@\n"
+	  "s@(va_list)&@(__gnuc_va_list)\\&@\n"
           "s@ _VA_LIST_));@ __gnuc_va_list));@\n"
           "s@ __VA_LIST__));@ __gnuc_va_list));@\n"
           "s@ va_list@ __not_va_list__@\n"


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