[patch objc]: Fix issue about LLP64 and -Wpadded
Nicola Pero
nicola.pero@meta-innovation.com
Thu Sep 30 13:53:00 GMT 2010
> Does this comment looks ok for you? If so, ok for apply?
Yes, it does look Ok, but I'd change the comment a bit (mostly grammar
changes). In fact, to avoid the back-and-forth about the comment, I
rewrote the comment for you in a way that seems Ok to me --
/* 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 *). */
So, Ok to apply with this reworked comment (or if you don't like it, feel free
to propose another one). ;-)
Thanks
--- struct_objc_class.h (revision 164743)
+++ struct_objc_class.h (working copy)
@@ -24,6 +24,13 @@
The sum of the class
definition and all super
class definitions. */
+#ifdef _WIN64
+ /* We do here structure padding manual. This is done by compiler
+ automatically, but would lead in combination with -Wpadded to
+ annoying warnings. This padding 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 +49,4 @@
struct objc_protocol_list *protocols; /* Protocols
conformed to
*/
void* gc_object_type;
};
+
More information about the Gcc-patches
mailing list