From efeb49b8138d9e5d97fda8ded0ce6b0dc21092ff Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 31 Mar 2008 17:43:18 +0100 Subject: Revert all usages of gcc's __extension__ keyword, and instead assert that our headers are not built with __GNUC__ and __STRICT_ANSI__. __extension__ had some weird (and buggy) behaviours when nested which make it a risky proposition for general usage in our header files. Better to disallow -ansi, -std=c99, and similar gcc options when building against Xen headers. Signed-off-by: Keir Fraser --- tools/include/xen-foreign/mkchecker.py | 3 --- tools/include/xen-foreign/mkheader.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'tools/include') diff --git a/tools/include/xen-foreign/mkchecker.py b/tools/include/xen-foreign/mkchecker.py index 264bf799b5..66c17b19e9 100644 --- a/tools/include/xen-foreign/mkchecker.py +++ b/tools/include/xen-foreign/mkchecker.py @@ -19,9 +19,6 @@ f.write(''' #include #include #include - -#define __anonymous_struct __extension__ struct -#define __anonymous_union __extension__ union '''); for a in archs: diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py index 17873e4842..8b249e3dfc 100644 --- a/tools/include/xen-foreign/mkheader.py +++ b/tools/include/xen-foreign/mkheader.py @@ -37,8 +37,8 @@ inttypes["x86_64"] = { "xen_pfn_t" : "__align8__ uint64_t", }; header["x86_64"] = """ -#ifdef __GNUC__ -# define __DECL_REG(name) __anonymous_union { uint64_t r ## name, e ## name; } +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +# define __DECL_REG(name) union { uint64_t r ## name, e ## name; } # define __align8__ __attribute__((aligned (8))) #else # define __DECL_REG(name) uint64_t r ## name -- cgit v1.2.3