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: Ping: [Patch, fortran] PR24558, PR20877 and PR25047 - module function alternate entries.


Tobi,

Taking my addition away:


The code looks like this: if (gfc_current_ns->parent == NULL) rc = gfc_get_symbol (name, NULL, result);

If there is no parent namespace; ie. this is an external procedure, gfc_get_symbol is called with a NULL, so that the current namespace is referenced. (There is a branch in gfc_get_symbol; if (NULL) use gfc_current_ns.)


  else
    rc = gfc_get_symbol (name, gfc_current_ns->parent, result);

Otherwise, if it is present, the parent namespace is used.


Both branches will do the same thing if (!module_fcn_entry) : the second argument to gfc_get_symbol will equal gfc_current_ns->parent, be it NULL or something else. In other words, the pre-existing if was pointless.

I am sorry but I do not agree. For external procedures and module subroutines, the highest level of namespace is used and this is different for each.


Paul


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