]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
struct_objc_class.h: Add padding to avoid warning with -Wpadded.
authorKai Tietz <kai.tietz@onevision.com>
Thu, 30 Sep 2010 09:01:19 +0000 (09:01 +0000)
committerKai Tietz <ktietz@gcc.gnu.org>
Thu, 30 Sep 2010 09:01:19 +0000 (11:01 +0200)
2010-09-30  Kai Tietz  <kai.tietz@onevision.com>

        * objc/deprecated/struct_objc_class.h: Add padding
        to avoid warning with -Wpadded.

From-SVN: r164746

libobjc/ChangeLog
libobjc/objc/deprecated/struct_objc_class.h

index 029b0a31ad8184236cedfc7891a4ce45ad893761..b1590c443744fbfbf5ab355bd9ac212bec41927c 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-30  Kai Tietz  <kai.tietz@onevision.com>
+
+       * objc/deprecated/struct_objc_class.h: Add padding
+       to avoid warning with -Wpadded.
+
 2010-09-26  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * encoding.c (objc_sizeof_type): Added support for vector type and
index 4918e738e8d3bfe2c49d679fa88e96b4663ca850..5a4859cbd656650ba0346e3d86e2a16bd04a6f9b 100644 (file)
@@ -24,6 +24,16 @@ struct objc_class {
                                                 The sum of the class 
                                                definition and all super 
                                                class definitions. */
+#ifdef _WIN64
+  /* We pad the structure manually to prevent warning when -Wpadded
+     is used.  The compiler automatically pads the structures that it
+     generates, so this manually padded structure still matches the one
+     generated by the compiler, but if we don't pad manually, -Wpadded
+     detects that padding is being added and generates annoying warnings.
+     This hack is necessary as on LLP64 targets sizeof (long) isn't equal
+     to sizeof (void *).  */
+  long pad;
+#endif
   struct objc_ivar_list* ivars;               /* Pointer to a structure that
                                                 describes the instance 
                                                 variables in the class
@@ -42,3 +52,4 @@ struct objc_class {
   struct objc_protocol_list *protocols;              /* Protocols conformed to */
   void* gc_object_type;
 };
+