bugGNUstep - Bugs: bug #32708, sizeof() on a class with...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #32708: sizeof() on a class with non-fragile ABI

Submitted by:  Chris Armstrong <carmstrong>
Submitted on:  Tue 08 Mar 2011 12:06:52 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed 09 Mar 2011 09:42:51 AM UTC, comment #2:

This works for me.

Chris Armstrong <carmstrong>
Tue 08 Mar 2011 12:56:10 PM UTC, comment #1:

Thanks for spotting that.
I don't think the patch does what's wanted (there should be nothing to copy in the non-fragile setup) ... but I applied a different fix in svn trunk ... please could you check and let me know if its working for you.

Richard Frith-Macdonald <CaS>
Project Member
Tue 08 Mar 2011 12:06:52 PM UTC, original submission:

I was compiling the latest version of gnustep-base from SVN (revision 32500), and I was running into trouble with NSDateFormatter and NSNumberFormatter, which both use internal classes. Their -copyWithZone: implementations had code like the following:

memcpy(o->_internal, internal, sizeof(NSDateFormatterInternal));

This code doesn't compile with clang and the -fnon-fragile-abi option because (I presume) the class size is determined at runtime. I've provided a patch below which fixes this problem by using the new class_getInstanceSize().

Chris Armstrong <carmstrong>

 

Attached Files
file #22855:  gnustep_base-fix_sizeof_call.patch added by carmstrong (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by carmstrong (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 09 Mar 2011 10:24:54 AM UTCCaSOpen/ClosedIn Test=>Closed
    Tue 08 Mar 2011 12:56:10 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test
    Tue 08 Mar 2011 12:06:52 PM UTCcarmstrongAttached File-=>Added gnustep_base-fix_sizeof_call.patch, #22855

    Back to the top


    Powered by Savane 3.1-cleanup1