https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119856

--- Comment #10 from Walter Spector <w6ws at earthlink dot net> ---
My bad.  Didn't have LD_LIBRARY_PATH set right...

$ ls -l $LD_LIBRARY_PATH/*gf*
-rw-r--r-- 1 root root 21336066 May 29 07:59 /usr/local/lib64/libgfortran.a
-rwxr-xr-x 1 root root      977 May 29 07:59 /usr/local/lib64/libgfortran.la
lrwxrwxrwx 1 root root       20 May 29 07:59 /usr/local/lib64/libgfortran.so ->
libgfortran.so.5.0.0
lrwxrwxrwx 1 root root       20 May 29 07:59 /usr/local/lib64/libgfortran.so.5
-> libgfortran.so.5.0.0
-rwxr-xr-x 1 root root 11500400 May 29 07:59
/usr/local/lib64/libgfortran.so.5.0.0
-rw-r--r-- 1 root root      278 May 29 07:59 /usr/local/lib64/libgfortran.spec
$

So now I get an error code from iostat - which is good.  But it is interesting
that the second write statement doesn't abend.  It prints the string 'value =',
and a '+' sign.  Then the program completes normally.  (Exit code 0.)  As if
the iostat= didn't reset something inside some internal I/O data structure.  So
when the print, and then the second write came along, it doesn't provide the
error.

$ gfortran -std=f95  badfmt2.f90
$ ./a.out
 ioerr =        5006
value =
+
$

If I remove the iostat= from the first write, as you did, I get an immediate
abend:

$ ./a.out
At line 7 of file badfmt2.f90 (unit = 6, file = 'stdout')
Fortran runtime error: Missing comma between descriptors
(AI5)     
  ^

Error termination. Backtrace:
#0  0x7f26028390fa in parse_format_list
        at ../../../gcc-trunk/libgfortran/io/format.c:1240
#1  0x7f260284c427 in data_transfer_init
        at ../../../gcc-trunk/libgfortran/io/transfer.c:3298
#2  0x4011ce in ???
#3  0x40134e in ???
#4  0x7f26021ff082 in __libc_start_main
        at ../csu/libc-start.c:308
#5  0x4010bd in ???
#6  0xffffffffffffffff in ???
$

Reply via email to