On Sat, Apr 05, 2025 at 03:16:45PM +0800, Gwen Fu wrote:
> My doubt :
> 1.Does the compilation option only need to support fortran versions above
> 9, o5r does it also need to support fortran 77?

gfortran started life as a Fortran 95 compiler.  It should
support anything that is Fortran 95 or later.

It is unclear why you are referring to Fortran 77.

> 2.Regarding parameter checking, *my idea is that after the user creates an
> array of a specified size, it is passed into the function as a parameter*.
> However, the array size required by the function does not match the size
> specified by the user. However, this idea seems to be impossible to
> implement in fortran77. *In addition, in addition to implicit and explicit
> size arrays, are there other data structures that require parameter type
> checking?*

The word "parameter" has very a specific meaning in Fortran.  The
entity that is passed into a function or subroutine is an "actual
argument".  The entity within the functions associated with the
"actual argument" is a "dummy argument".

It is not clear to me what you're trying to accomplish.  gfortran
already has an -fimplicit-none option that enforces no implicit
typing.  This option will catch the "typo" type error.  Gfortran
also has the -fallow-argument-mismatch.   If the code is within
a single file, gfortran will build an explicit interface when 
it encounters an external procedure, and then it uses that interface
to check any additional references. 

> 3.
> I found out that "-fcheck=*" is an option for runtime checking, but the
> relevant options are commented out.
>   OPT_fcheck_ = 1070,                        /* -fcheck= */
>   /* OPT_fcheck_assert = 1071, */            /* -fcheck=assert */
>   /* OPT_fcheck_bounds = 1072, */            /* -fcheck=bounds */
>   /* OPT_fcheck_in = 1073, */                /* -fcheck=in */
>   /* OPT_fcheck_invariant = 1074, */         /* -fcheck=invariant */
>   /* OPT_fcheck_out = 1075, */               /* -fcheck=out */
>   /* OPT_fcheck_switch = 1076, */            /* -fcheck=switch */
>   OPT_fcheckaction_ = 1077,                  /* -fcheckaction= */
>   OPT_fchecking = 1078,                      /* -fchecking */
> 
> And I tried :
> $ gfortran -o fibonacci fabonaqi.f90 -fcheck=in
> f951: Warning: command-line option ‘-fpreconditions’ is valid for D but not
> for Fortran
> $ gfortran --help=check
> cc1: warning: unrecognized argument to ‘--help=’ option: ‘check’
> So Is this related  to the project ?

I've already pointed out that some of these options do not apply 
to Fortran.

Did you try 'gcc --help=check'?

% ~/work/bin/gcc --help=check
cc1: warning: unrecognized argument to '--help=' option: 'check'

The second result you show is not a gfortran problem.

-- 
Steve

Reply via email to