This is the mail archive of the gcc-bugs@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]

[Bug libobjc/16110] New: +load is not called on all the categories.


Highlevel explanation
----------------------
libobjc keeps track of all the modules
it has seen.  This list of modules seen is used
to determine if +load should be sent.  If a category
on a class is defined in a different module than the class and
the class is defined in a module already seen, the category
will not be sent the +load message.

This bug is also reported for GNUstep as:

https://savannah.gnu.org/bugs/?func=detailitem&item_id=9379

And this bug report contains a patch for the libobjc shipped
with GNUstep.

How to reproduce
----------------
I can't seem to attach files which show the problem, so
here goes a description. (For files see the GNUstep bug
report mentioned above).

* Create two files, A.m and B.m
* A.m should contain:
  implementation of class A including +load implementation
  implementation of category on B including +load implementation
* B.m should contain:
  implementation of class B including +load implementation
  implementation of category on A including +load implementation
* compile with
  gcc -o loadTest A.m B.m -lobjc
* run and check that 3 of the 4 load implemnetations are called
 
Fix
---
I have a patch for the GNUstep libobjc.  There are however two problems
with it:
* It is probably not a very clean fix, so it needs to be improved.  But
  I am not an export on the libobjc runtime.
* I do not know for which version of gcc to create a patch. 
I am willing to modify my patch for gcc, but before I download
the gcc sources I would like to have pointer to the relevant version.

-- 
           Summary: +load is not called on all the categories.
           Product: gcc
           Version: 3.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libobjc
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: woudshoo at xs4all dot nl
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16110


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