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]

PATCH for va_list type on IRIX6



On IRIX6, va_list is supposed to be `char*'.  Making it `void*' causes
problems in C++, where you can't cast from the latter to the former. 
The IRIX6 headers look like:

  extern int	vprintf(const char *, /* va_list */ char *);

I checked in this patch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Thu Sep 30 23:04:41 1999  Mark P. Mitchell  <mark@codesourcery.com>

	* iris6.h (BUILD_VA_LIST_TYPE): Define.

Index: testsuite/g++.old-deja/g++.other/vaarg1.C
===================================================================
RCS file: vaarg1.C
diff -N vaarg1.C
*** /dev/null	Sat Dec  5 20:30:03 1998
--- vaarg1.C	Fri Oct  1 00:00:35 1999
***************
*** 0 ****
--- 1,14 ----
+ // Build don't link:
+ // Origin: Mark Mitchell <mark@codesourcery.com>
+ 
+ #include <stdarg.h>
+ #include <stdio.h>
+ 
+ void f (int i, ...)
+ {
+   va_list ap;
+ 
+   va_start (ap, i);
+   vprintf ("test", ap);
+   va_end (ap);
+ }
Index: config/mips/iris6.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/config/mips/iris6.h,v
retrieving revision 1.16
diff -c -p -r1.16 iris6.h
*** iris6.h	1999/07/22 02:16:55	1.16
--- iris6.h	1999/10/01 06:51:37
*************** do									\
*** 438,443 ****
--- 438,449 ----
   }									\
  while (0)
  
+ /* Define the `__builtin_va_list' type for the ABI.  On Irix6, this
+    type is `char *'.  */
+ #undef BUILD_VA_LIST_TYPE
+ #define BUILD_VA_LIST_TYPE(VALIST) \
+   (VALIST) = build_pointer_type (char_type_node)
+ 
  /* Output the size directive for a decl in rest_of_decl_compilation
     in the case where we did not do so before the initializer.
     Once we find the error_mark_node, we know that the value of


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