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]

Re: objc runtime: cannot find class Object



  In message <199906151504.LAA17130@hiauly1.hia.nrc.ca>you write:
  > I believe that this is the situation.
OK.

  > I think it is an error for gcc
  > not to output a static function which is never referenced (inlined).
I disagree strongly.  If a static function is never referenced except by
self references is is entirely normal and sane for the compiler or the linker
to delete it as unreachable code.

Do you expect the compiler to elete unreachable code within a function?  I
thought so ;-)  Deleting an unreachable function is a simple extension of that
same optimization.  If the function can not be reached, then there's no reason
the compiler or linker can't delete it.

  > A simple solution is to remove the static declaration from the function.
  > As a result, the function becomes global in scope.  I don't think that
  > the additional namespace pollution is a big deal.  The kludge of the
  > function calling itself to prevent a warning message can then be removed.
Making the function global is another option.  If do we do that, we need to
add an underscore or two to its name.  Namespace pollution is an important
issue and we should not pollute the namespace unnecessarily.

And yes, with either solution we can remove the kludge.
jeff


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