[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.1-testing] Prefix unnamed union structure fields with __extension__ to make it



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206524525 0
# Node ID 4e8d4c6fda77622ceac4d6c535dc0c2a33f3b025
# Parent  d68fc8b831eb1ce1c780e667d06ea52c69fc19dd
Prefix unnamed union structure fields with __extension__ to make it
work properly even in e.g. C99 standard mode.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
xen-unstable changeset:   17288:f5e6cccfdda5537876d6fc2b87ea1124d6043fc8
xen-unstable date:        Tue Mar 25 18:02:00 2008 +0000
---
 xen/include/public/arch-ia64.h           |   10 ++++++----
 xen/include/public/arch-x86/xen-x86_64.h |    2 +-
 xen/include/public/foreign/mkheader.py   |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff -r d68fc8b831eb -r 4e8d4c6fda77 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h    Wed Mar 26 09:40:12 2008 +0000
+++ b/xen/include/public/arch-ia64.h    Wed Mar 26 09:42:05 2008 +0000
@@ -73,6 +73,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 
 #ifndef __ASSEMBLY__
 
+#define __anonymous_union __extension__ union
+
 typedef unsigned long xen_ulong_t;
 
 #define INVALID_MFN       (~0UL)
@@ -241,11 +243,11 @@ struct mapped_regs {
     unsigned long  reserved1[29];
     unsigned long  vhpi;
     unsigned long  reserved2[95];
-    union {
+    __anonymous_union {
         unsigned long  vgr[16];
         unsigned long bank1_regs[16]; // bank1 regs (r16-r31) when bank0 active
     };
-    union {
+    __anonymous_union {
         unsigned long  vbgr[16];
         unsigned long bank0_regs[16]; // bank0 regs (r16-r31) when bank1 active
     };
@@ -256,7 +258,7 @@ struct mapped_regs {
     unsigned long  vpsr;
     unsigned long  vpr;
     unsigned long  reserved4[76];
-    union {
+    __anonymous_union {
         unsigned long  vcr[128];
         struct {
             unsigned long dcr;  // CR0
@@ -290,7 +292,7 @@ struct mapped_regs {
             unsigned long rsv6[46];
         };
     };
-    union {
+    __anonymous_union {
         unsigned long  reserved5[128];
         struct {
             unsigned long precover_ifs;
diff -r d68fc8b831eb -r 4e8d4c6fda77 xen/include/public/arch-x86/xen-x86_64.h
--- a/xen/include/public/arch-x86/xen-x86_64.h  Wed Mar 26 09:40:12 2008 +0000
+++ b/xen/include/public/arch-x86/xen-x86_64.h  Wed Mar 26 09:42:05 2008 +0000
@@ -141,7 +141,7 @@ struct iret_context {
 
 #ifdef __GNUC__
 /* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */
-#define __DECL_REG(name) union { \
+#define __DECL_REG(name) __extension__ union { \
     uint64_t r ## name, e ## name; \
     uint32_t _e ## name; \
 }
diff -r d68fc8b831eb -r 4e8d4c6fda77 xen/include/public/foreign/mkheader.py
--- a/xen/include/public/foreign/mkheader.py    Wed Mar 26 09:40:12 2008 +0000
+++ b/xen/include/public/foreign/mkheader.py    Wed Mar 26 09:42:05 2008 +0000
@@ -38,7 +38,7 @@ inttypes["x86_64"] = {
 };
 header["x86_64"] = """
 #ifdef __GNUC__
-# define __DECL_REG(name) union { uint64_t r ## name, e ## name; }
+# define __DECL_REG(name) __extension__ union { uint64_t r ## name, e ## name; 
}
 # define __align8__ __attribute__((aligned (8)))
 #else
 # define __DECL_REG(name) uint64_t r ## name

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.