[Patch, Fortran] PR fortran/35723: Some fixes to restricted-expression handling

Daniel Kraft d@domob.eu
Fri Sep 26 13:57:00 GMT 2008


Dominique Dhumieres wrote:
> Daniel,
> 
>> 4) To fix the duplicated error message problem reported also in the PR, ...
> 
> Your "suppress-errors" is apparently too drastic. For the following code (reduced from pr36192):
> 
> program three_body
> 
>   real, parameter :: &
>        precision_goal = 0.01, &
>        dt_init = 0.01, &
>        duration = 20, &
>        n = 2, &
>        d = 2
> 
>   real, dimension(n), parameter :: m = (/ 1.0, 1.0 /)
> 
>   real, dimension(n,d) :: &
>        x, v, &                  ! Configuration at current t
>        x_n, v_n, &              ! Configuration at t+dt with step dt
>        x_hq, v_hq               ! Configuration at t=dt with step dt/2
> 
>   real, parameter :: &
>        G = 1
> 
>   real :: &
>        dt = dt_init, &
>        t = 0
>   integer :: i,j
> 
> end program three_body

Hi Dominique,

thanks for finding this!  I confirm that removing the error suppressing 
from resolve.c:is_non_constant_shape_array (where I added it in the 
first place) changes this to display the REAL/INTEGER mismatch errors; 
so it's not something messed up while reworking error suppressing in 
general.

However, I would expect a function called "is_non_constant_shape_array" 
to simply return true/false and not report errors to the user; or do you 
disagree?  So I would propose (if that's possible) to get the errors 
back some other way; or, at least add some comment to the method 
description stating explicitly that errors may be reported and this is 
supposed to be so?

Yours,
Daniel

-- 
Done:  Arc-Bar-Cav-Rog-Sam-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran-Tou



More information about the Fortran mailing list