This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A question on GFortran



Let us consider the following program
----------------------------------------------------
$ cat h.F
      program hello
      implicit none
      integer i
      i = 0
      if (i.eq.0) stop 99901
      write(*,*) 'Hello!'
      end
----------------------------------------------------


and the following script
------------------------------------
$ cat run_h.sh
#!/bin/bash

build()
{

./h || return 1

echo "Hello"
}

build

------------------------------------


When one builds 'h.F' with G77, running the script, the result is:  
-----------------------------------------
g77 h.F -o h

$ ./run_h.sh
STOP 99901 statement executed
Hello
-----------------------------------------


If, instead, one build 'h.F' with GFortran:
---------------------------------------
$ gfc h.F -o h
  
$ ./run_h.sh
STOP 99901
---------------------------------------


i.e. in the first case the script line

   echo "Hello"

is executed, in the second NO.

This is because G77 does not intercept the execution of

  STOP 99901

like an abnormal termination.


I would ask if there is a GFC option or environment variable to set so
that the GFC behaviour is similar to that of G77.



   Angelo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]