[Patch, Fortran, OOP] PR 47978: Invalid INTENT in overriding TBP not detected

Janus Weil janus@gcc.gnu.org
Sun Sep 11 21:51:00 GMT 2011


Hi Tobias,

>> Update: Here is an extended version of the patch, which adds a few
>> additional checks:
>>
>> The patch still regtests cleanly. Ok for trunk?
>
>> +      switch (compval)
>> +      {
>
> ...
>>
>> +       default:
>> +         gfc_internal_error ("check_dummy_characteristics: Unexpected
>> result "
>> +                             "%i of gfc_dep_compare_expr", compval);
>> +         break;
>> +      }
>> +    }
>
> I think we really should move to enum.

Agreed. However, I'm afraid this is not completely trivial. I'll open
a PR for it.


>> +         gfc_error (strcat (err, " of '%s' at %L with respect to the "
>> +                            "overridden procedure"), proc->name,&where);
>>          return FAILURE;
>
> That's extremely unfriendly to translators; additionally, using
>  ("%s of '%s' ...", err, ...
> you could avoid calling strcat. That way one also avoids problems like
> exceeding the length of err.
>
> How about something like
>  "Argument mismatch for the overridden procedure '%s' at %L: %s"
> which is easier to translate - and might be also easier to understand for a
> user.

Good point. I'm not sure why I invented this ugly strcat hack. Now I
changed the error message to what you suggested, except that it should
say "the overriding procedure".


> Otherwise, the patch looks OK.

Thanks a look for the review. Committed as r178767.

Cheers,
Janus



More information about the Gcc-patches mailing list