[Patch, Fortran, F03] PR 40869: PPC assignment checking

Janus Weil janus@gcc.gnu.org
Thu Aug 27 17:40:00 GMT 2009


>> So, what I did in this case was to simplify the problem by using not
>> the component itself for the comparison, but instead the symbol which
>> it gets its interface from (ts.interface). Since this is a normal
>> gfc_symbol, it can be passed to the existing gfc_compare_interfaces
>> without any problem. One drawback of this method is that the error
>> messages contain the wrong name, or an empty name (if the PPC was
>> declared like e.g. "procedure(real), pointer ..."). So far this is the
>> only drawback I see. And this method is a lot more elegant than any of
>> the other solutions I could think of.
>
> I think this solution is ok.  You could of course add two arguments for the
> names for error messages to gfc_compare_interfaces to fix that problem, but
> I'm not sure if that's really needed (at least not for now).

Actually only one argument is needed, since only one name is used. I
have already discussed this with Tobias, and I think this is what we
should do (updated patch attached), even if it only shows the name of
the component, and not the whole thing (obj%ppc). But I think this is
ok for the purpose.

If no one objects, I will commit the updated patch later today or tomorrow.


> Or, for all of these problems you could try to rework gfc_compare_interfaces
> to work only on some common part of the things it is passed (similar to your
> polymorphism approach for gcc-in-cxx) where possible, I tried this some
> times for TBPs

You just thought about doing this, or you actually did? If you did,
can you point me at the place in the source?

I'm not completely sure what you mean, though. Like passing e.g.
sym->ts and sym->attr instead of sym? Or rather passing an actual
gfc_component for a formal gfc_symbol? (This currently won't work,
since common things like ts and attr have a different offset in both.)

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr40869_new.diff
Type: text/x-diff
Size: 5916 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090827/80825a67/attachment.bin>


More information about the Fortran mailing list