summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2010-09-30 09:01:19 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2010-09-30 11:01:19 +0200
commit2de87f04d8e84834da204ded5a48e2baf0e4bc34 (patch)
tree65d43440c093c4da80fbb9b5cc58e5ac30c71332
parent2631eead416342cedd854249572d762ee1ce8efa (diff)
downloadgcc-2de87f04d8e84834da204ded5a48e2baf0e4bc34.tar.gz
struct_objc_class.h: Add padding to avoid warning with -Wpadded.
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
-rw-r--r--libobjc/ChangeLog5
-rw-r--r--libobjc/objc/deprecated/struct_objc_class.h11
2 files changed, 16 insertions, 0 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 029b0a31ad8..b1590c44374 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -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
diff --git a/libobjc/objc/deprecated/struct_objc_class.h b/libobjc/objc/deprecated/struct_objc_class.h
index 4918e738e8d..5a4859cbd65 100644
--- a/libobjc/objc/deprecated/struct_objc_class.h
+++ b/libobjc/objc/deprecated/struct_objc_class.h
@@ -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;
};
+