[Patch, Fortran, OOP] PR 48095: Invalid assignment to procedure pointer component not rejected

Janus Weil janus@gcc.gnu.org
Wed Sep 7 21:34:00 GMT 2011


Hi Tobias,

>> +         if (s2&&  !gfc_compare_interfaces (comp->ts.interface, s2, name,
>> 0, 1,
>> +                                            err, sizeof(err)))
>
> Space after sizeof.

Fixed.


>> +             gfc_error ("In derived type constructor at %L: Interface
>> mismatch"
>> +                        " in procedure pointer component '%s': %s",
>> +                       &cons->expr->where, comp->name, err);
>
> Somehow, I find the words clumsy with too many colons. "derived type
> constructor" - I'd use a hyphen ("derived-type") and I want to note that the
> standard calls it "structure constructor"; I also would use "for ...
> component" and not "in ... component" and add a hyphen to "procedure
> pointer".

You are right about the hyphens, and I also agree that it makes more
sense to stick to the standard language. Note: My wording was partly
copied over from other error messages in resolve_structure_cons, all
of which use "derived type constructor". I'm changing all of them in
the attached update of the patch.


> How about a simpler: "Interface mismatch for procedure-pointer component
> '%s' at %L: %s"? I think it should be clear from the context that it is
> about a structure constructor. Or for the long version, how about:
> "Interface mismatch for procedure-pointer component '%s' in structure
> constructor at %L: %s"?

I prefer the second variant.

I'll do another regtest with the updated patch (the changed error
messages might need testsuite adaptions?) and then go ahead and commit
it.

Thanks for the review.

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr48095_v2.diff
Type: text/x-diff
Size: 3934 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110907/d0517648/attachment.bin>


More information about the Gcc-patches mailing list