This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, OOP] PR 56261: seg fault call procedure pointer on polymorphic array
- From: Tobias Burnus <burnus at net-b dot de>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 11 Apr 2013 23:57:50 +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>
Am 11.04.2013 23:38, schrieb Janus Weil:
2013/4/11 Tobias Burnus <burnus@net-b.de>:
Comment to Janus: It should be possible to disable the error check,
e.g. by making it a warning.
That's actually what the current code does: By default,
it only warns and does not print an error.
No, at least the type mismatch and char-len checks always seem to
throw an error ...
Only for function-result types:
Error: Return type mismatch of function 'foo' at (1) (REAL(4)/COMPLEX(4))
But not for arguments:
subroutine foo(x)
complex x(2)
end subroutine foo
real :: r(4)
call foo(r)
end
Warning: Type mismatch in argument 'x' at (1); passed REAL(4) to COMPLEX(4)
That's also how NAG's "f95 -dirty" handles it.
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.
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.
(Actually, we already got bug reports about rejected code where the
message explicitly stated after the error "This check can be disabled
with the option -fno-range-check". Thus, some users do not even read the
error message carefully.)
Tobias
- 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