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]

[patch] PR35460 fix OpenBSD stdarg header


Hello,

this patch to fixincludes fixes the OpenBSD stdarg.h header to use __builtin_va_start iso. __builtin_stdarg_start.


This is how the fixed header looks like:
------
[deuterium_obsd:objdir/gcc/include-fixed] andreast% diff -u /usr/include/stdarg.h stdarg.h
--- /usr/include/stdarg.h Tue Dec 30 13:52:12 2008
+++ stdarg.h Tue Dec 30 14:14:20 2008
@@ -1,3 +1,12 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/usr/include/stdarg.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:06 millert Exp $ */
/*
* Copyright (c) 2003, 2004 Marc espie <espie@openbsd.org>
@@ -31,7 +40,7 @@
actual type **after default promotions**.
Thus, va_arg (..., short) is not valid. */


-#define va_start(v,l)  __builtin_stdarg_start((v),l)
+#define va_start(v,l)  __builtin_va_start((v),l)
 #define va_end         __builtin_va_end
 #define va_arg         __builtin_va_arg
 #define va_copy(d,s)   __builtin_va_copy((d),(s))
-----

Ok for 4.4?

Thanks,
Andreas


2008-12-30 Andreas Tobler <a.tobler@schweiz.org>


	PR target/35460
	* inclhack.def (openbsd_va_start): Use __builtin_va_start for OpenBSD.
	* fixincl.x: Regenerate.


Index: inclhack.def =================================================================== --- inclhack.def (revision 142962) +++ inclhack.def (working copy) @@ -2541,7 +2541,19 @@ test_text = "*((void **) (h)->next_free)++ = (aptr)"; };

+/*
+ * Fix OpenBSD's va_start define.
+ */
+fix = {
+  hackname  = openbsd_va_start;
+  mach      = "*-*-openbsd*";
+  files     = stdarg.h;
+  select    = '__builtin_stdarg_start';
+  sed       = 's/__builtin_stdarg_start/__builtin_va_start/';

+  test_text = "#define va_start(v,l)   __builtin_va_start((v),l)";
+};
+
 /*
  *  sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
  *  defining regex.h related types.  This causes libg++ build and usage


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