My doubt :
1.Does the compilation option only need to support fortran versions above
9, o5r does it also need to support 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?*
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 ?

Here is my proposal draft (importran part )
Parameter Mismatch Implicit Declaration Features of Fortran 77

I think this is the reason why parameter mismatch may occur

In *Fortran 77*, *Implicit Typing* is a variable type automatic inference
mechanism, that is, *the compiler automatically determines its data type
based on the first letter of the variable name* without explicit
declaration.
Variable first characterDefault data type
A-H O-Z AH OZ REAL (single-precision floating point number)
I-N INTEGER (integer)

*This will lead*

   -

   *Error-prone*: If you make a typo (e.g., TOTAL is mistakenly written as
   TOAL), the compiler will not report an error, but the variable type may
   change.
   -

   *Poor code readability*: Implicit rules are not intuitive, increasing
   maintenance difficulty.


Parameter mismatch of implicit-size or explicit-size array

*1. Assumed-size Array*

*Syntax example:*

SUBROUTINE SUB(A)
  DIMENSION A(*)  ! Assumed-size array
  INTEGER A
  ! ...
END

*Potential issues:*

   -

   *No bounds checking*: The compiler does not know the actual size of the
   array passed in, and relies entirely on the programmer to ensure correct
   access.
   -

   *Out-of-bounds risk*: If A(i) is accessed inside the function but i
   exceeds the actual array range, undefined behavior (such as memory
   corruption, program crash) will occur.
   -

   *No shape checking*: Even if the dimensions of the array passed in do
   not match (such as A(10) but the actual passed in A(5)), the compiler
   will not report an error.

*2. Explicit-size Array *

*Syntax example:*

SUBROUTINE SUB(A, N)
  DIMENSION A(N)  ! Explicit-size Array
  INTEGER A, N
  ! ...
END

*Potential Issues:*

   -

   *Manual Size Passing*: The array size N must be passed additionally,
   which is prone to errors (e.g. passing the wrong N).
   -

   *Mismatch Risk*: If N is larger than the actual array size, the function
   may access illegal memory.
   -

   *No Dimension Check*: The compiler will not warn even if the array
   dimensions passed in are different (e.g. A(10) vs A(5,2)).

Technology stack mastered

   -

   Familiar with C++/C language
   -

   Familiar with Linux environment programming, proficient in three IO
   multiplexing technologies: epoll, select, and poll, and their underlying
   principles
   -

   Proficient in debugging tools such as gdb valgrind
   -

   Understand Fortran language


Projects participated in

   -

   Personal project Lightweight HTTP server based on Reactor mode
   <https://github.com/gggggwen/HTTPWebServer>

This project is developed in C++, including log output module, connection
management module, business module, and I/O processing connection request
processing module

   -

   OSPP-2024 Kytunig-Client data output function module development
   <https://gitee.com/openeuler/kytuning-client>

This project is developed in Python, and its core functions include
deserialization of JSON data and conversion of JSON data into Excel files.

Reply via email to