[PATCH] D28620: Guard __gnuc_va_list typedef
Paul Robinson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 23 11:20:29 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL292819: Guard __gnuc_va_list typedef. (authored by probinson).
Changed prior to commit:
https://reviews.llvm.org/D28620?vs=84151&id=85430#toc
Repository:
rL LLVM
https://reviews.llvm.org/D28620
Files:
cfe/trunk/lib/Headers/stdarg.h
cfe/trunk/test/Headers/stdarg-gnuc_va_list.c
Index: cfe/trunk/test/Headers/stdarg-gnuc_va_list.c
===================================================================
--- cfe/trunk/test/Headers/stdarg-gnuc_va_list.c
+++ cfe/trunk/test/Headers/stdarg-gnuc_va_list.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wsystem-headers -std=c99 %s
+// expected-no-diagnostics
+
+// Check that no warnings are emitted from stdarg.h if __gnuc_va_list has
+// previously been defined in another header file.
+typedef __builtin_va_list __va_list;
+typedef __va_list __gnuc_va_list;
+#define __GNUC_VA_LIST
+
+#include <stdarg.h>
Index: cfe/trunk/lib/Headers/stdarg.h
===================================================================
--- cfe/trunk/lib/Headers/stdarg.h
+++ cfe/trunk/lib/Headers/stdarg.h
@@ -43,10 +43,9 @@
#define va_copy(dest, src) __builtin_va_copy(dest, src)
#endif
-/* Hack required to make standard headers work, at least on Ubuntu */
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST 1
-#endif
typedef __builtin_va_list __gnuc_va_list;
+#endif
#endif /* __STDARG_H */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28620.85430.patch
Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170123/f4b6e7fd/attachment.bin>
More information about the cfe-commits
mailing list