This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch objc]: Fix issue about LLP64 and -Wpadded



On 29 Sep 2010, at 21:29, Nicola Pero wrote:


Kai,

it's not entirely obvious to me that this patch is safe. ;-)

The declaration in the libobjc headers is used to access structures that
are actually generated by the compiler when compiling an Objective-C
module (see gcc/objc/objc-act.c, build_class_template()).


If you change the declaration of the structure in libobjc (and assuming the
change actually does something), wouldn't you need to change the compiler
as well ?


But changing the layout of struct objc_class generated by the compiler would
break the ABI (and would break it seriously, it's not a detail), which is a pain
if it means you can't use GCC 4.6 for Objective-C if anything Objective-C on your
machine has been ever compiled by an older GCC.


I'd say when we change the Objective-C ABI to implement Objective-C 2.0 features
(most likely in the next release of the compiler) we could address padding of structures
as part of the change. ;-)


But maybe I'm misunderstanding your patch. Feel free to explain it and point out
anything I may have missed :-)

I wonder if the field can be declared 'packed' to avoid the padding warning?


Changing the compiler-generated metadata at this stage would not be a favorite....
... much better to sync with the move to ABI 2 as you suggest,


cheers,
Iain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]