This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: objc runtime: cannot find class Object
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: objc runtime: cannot find class Object
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 15 Jun 1999 13:20:40 -0600
- cc: egcs-bugs at egcs dot cygnus dot com
- Reply-To: law at cygnus dot com
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