about summary refs log tree commit diff
path: root/arch/i386/bits
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-27 23:41:48 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-27 23:41:48 -0400
commitdef0af189871a499efdc9bc37438d8b20eb702ab (patch)
treed63aa5d2b91fd1dfc6098f41871eb582f4da5655 /arch/i386/bits
parente6bac87d0eaab116878a04874bc5b6a3496cb938 (diff)
downloadmusl-def0af189871a499efdc9bc37438d8b20eb702ab.tar.gz
musl-def0af189871a499efdc9bc37438d8b20eb702ab.tar.xz
musl-def0af189871a499efdc9bc37438d8b20eb702ab.zip
use compiler builtins for variadic macros when available
this slightly cuts down on the degree musl "fights with" gcc, but more
importantly, it fixes a critical bug when gcc inlines a variadic
function and optimizes out the variadic arguments due to noticing that
they were "not used" (by __builtin_va_arg).

we leave the old code in place if __GNUC__ >= 3 is false; it seems
like it might be necessary at least for tinycc support and perhaps if
anyone ever gets around to fixing gcc 2.95.3 enough to make it work..
Diffstat (limited to 'arch/i386/bits')
-rwxr-xr-xarch/i386/bits/alltypes.h.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/i386/bits/alltypes.h.sh b/arch/i386/bits/alltypes.h.sh
index 9d94c911..335c0957 100755
--- a/arch/i386/bits/alltypes.h.sh
+++ b/arch/i386/bits/alltypes.h.sh
@@ -19,7 +19,12 @@ union \1 \2;\
 TYPEDEF unsigned size_t;
 TYPEDEF int ssize_t;
 TYPEDEF long ptrdiff_t;
+
+#if __GNUC__ >= 3
+TYPEDEF __builtin_va_list va_list;
+#else
 TYPEDEF struct __va_list * va_list;
+#endif
 
 TYPEDEF long wchar_t;
 TYPEDEF long wint_t;