[fortran] Add runtime warning mechanism to libgfortran
FX Coudert
fxcoudert@gmail.com
Wed Aug 3 19:15:00 GMT 2005
Attached patch adds a new mechanism of runtime warnings and errors in
libgfortran. This enables us to warn/error about non-standard complying
constructions and extensions that can only be detected at runtime (such
as format descriptor extensions) when -pedantic is specified during the
compilation of the main program. The first such case is the $ edit
descriptor:
malo ~/gfortran/debug $ cat dollar2.f
character*5 c
open (42,status='scratch')
write (42,'(A,$)') 'abc'
write (42,'(A)') 'de'
rewind (42)
read (42,'(A)') c
close (42)
if (c /= 'abcde') print *, 'ERROR'
end
malo ~/gfortran/debug $ gfc dollar2.f
malo ~/gfortran/debug $ ./a.out
malo ~/gfortran/debug $ gfc -std=f95 -pedantic dollar2.f
malo ~/gfortran/debug $ ./a.out
At line 3 of file dollar2.f
Fortran runtime error: Extension: $ descriptor
Bootstrapped and regtesting in progress on i686-linux and x86_64-linux.
OK for mainline (and 4.0 after testing)?
FX
:ADDPATCH fortran:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: library_warn.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050803/6aa0184e/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: library_warn.ChangeLog
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050803/6aa0184e/attachment-0001.ksh>
More information about the Fortran
mailing list