bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Chris Armstrong
Subject: [bug #32708] sizeof() on a class with non-fragile ABI
Date: Tue, 08 Mar 2011 12:06:53 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15

URL:
  <http://savannah.gnu.org/bugs/?32708>

                 Summary: sizeof() on a class with non-fragile ABI
                 Project: GNUstep
            Submitted by: carmstrong
            Submitted on: Tue 08 Mar 2011 12:06:52 PM GMT
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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().



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 08 Mar 2011 12:06:52 PM GMT  Name:
gnustep_base-fix_sizeof_call.patch  Size: 1kB   By: carmstrong

<http://savannah.gnu.org/bugs/download.php?file_id=22855>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?32708>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]