[GSoC]Fortran – run-time argument checking
Steve Kargl
sgk@troutmask.apl.washington.edu
Tue Mar 25 17:04:04 GMT 2025
On Tue, Mar 25, 2025 at 08:34:51PM +0800, Gwen Fu wrote:
> 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 what's wrong with these ?
Those options do not apply to gfortran, e.g.,
% find gcc/fortran -type f | xargs grep -i fcheck_invariant
% find libgfortran -type f | xargs grep -i fcheck_invariant
The gfortran manual tells you which keywords are supported:
-fcheck=<all|array-temps|bits|bounds|do|mem|pointer|recursion>
--
Steve
More information about the Fortran
mailing list