This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Apr 2013 00:17:59 +0200
- Subject: Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- References: <CAKwh3qiaKALyvJnMHrGMo1P0suzxim+CXy=9VykJ1DRfN1hb5g at mail dot gmail dot com> <5161BB3C dot 30203 at net-b dot de> <CAKwh3qjxZJ0toSS7yGb90+3jP3XYEvnoQu1rrWe68zL3ZYEY0Q at mail dot gmail dot com> <5161D100 dot 5030205 at net-b dot de> <CAKwh3qjan_X6r0e_Kiv7-O_3VquZ2qU4BBoQ6kOg784ma_5RsQ at mail dot gmail dot com> <51659652 dot 60705 at net-b dot de> <CAKwh3qik3LJKKqNvwF+_GmORUnXiuBmcTGHHbY+RSurfcJX4hA at mail dot gmail dot com> <CAKwh3qjthydw=nghLXOC3x0zd24Q8tDus4+e7iqS0rbzR4E9AQ at mail dot gmail dot com> <5166D77B dot 50508 at net-b dot de> <CAKwh3qiJZAU-oPSVF8R1gsN0-hdo317NgpgzMfE=oT-qN+ChFw at mail dot gmail dot com> <516731DE dot 8070104 at net-b dot de>
>>> Thus, I think one should be strict about the requires-explicit-interface
>>> diagnostic (= new code, using F90+), but for interface mismatch (= could
>>> be
>>> old Fortran 66 code), it should be either disabled or - as currently -
>>> just
>>> be a warning.
>>
>> How about enabling it by default, but having -std=legacy disable the
>> checks?
>
> Hmm, I think I'd prefer to have for the arguments only a warning with
> -std=gnu - except for the function result value, which should always be an
> error. And also the "requires an explicit interface" checks should always
> use an error.
Why the distinction (apart from: NAG does it this way)?
The nice thing about the current patch is that it just relies on the
full machinery of "gfc_compare_interfaces". Making distinctions about
where to give an error or warning probably requires again a certain
amount of code-duplication from interface.c. Or do you see a
technically simple way to do this?
> However, if one goes for an error with -std=gnu, the error should explicitly
> mention that "-std=legacy" disables the error. At least I do not recall all
> the special flags which enable certain features, nor whether such a flag
> exists at all. And I doubt that a normal user do.
That's right. Might be worth to add it. Although the folks which
operate such 'dirty' legacy codes hopefully know about the usefulness
of -std=legacy ...
Cheers,
Janus
- References:
- [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array