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

Re: TREE_PUBLIC vs DECL_EXTERNAL


>>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:

> I was surprised to discover that we were setting DECL_EXTERNAL
> on static functions.  Which is confusing to me, because I 
> thought DECL_EXTERNAL means "defined in some other object".
> Which can't be true for !TREE_PUBLIC.

I thought it just meant "not defined yet".  How would you distinguish a
static forward decl from a definition?  Just by whether or not TREE_STATIC
is set?

check_global_declarations checks DECL_EXTERNAL to determine whether or not
a static function has been defined.

> I also ran into problems with libjava/jni.cc from the C++ front
> end.  I'm assuming the problem there is that some of the scary
> DECL_NOT_REALLY_EXTERN stuff slipped through.  Certainly I don't
> feel that I understand that code enough to touch it.

I'm currently banging my head against that code, trying to come up with a
more coherent linkage model.

Jason


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