diff mbox

[fortran] F2003 "non-default kind specifiers" compliance

Message ID 05D8E558-7941-41F0-B02B-D7D94BB0ABF8@gmail.com
State New
Headers show

Commit Message

FX Coudert June 6, 2014, 4:21 p.m. UTC
Hi all,

Our Fortran 2003 status page [1] says gfortran does not support "Kind type parameters of integer specifiers”. This item is defined thusly (item 4.9 in [2]):

> Some of the integer specifiers (e.g. NEXTREC) were limited to default kind in Fortran 95. Any kind of integer is permitted in Fortran 2003.


I wanted to fix this, so I combed through the 95, 2003 and 2008 standards, and listed these changes. F2003 lifted all requirements on integer specifiers, and F2008 lifted requirements on logical specifiers. However, it appears that all of these are actually already handled in current trunk! So I’m proposing a simple two-fold action:

  - update the Fortran 2003 status to indicate our compliance
  - commit the attached testcase (bootstrapped and regtested on x86_64-apple-darwin) which will make sure we stay that way.

OK?


[1] https://gcc.gnu.org/wiki/Fortran2003Status
[2] ftp://ftp.nag.co.uk/sc22wg5/N1551-N1600/N1579.pdf

Comments

Steve Kargl June 6, 2014, 7:52 p.m. UTC | #1
On Fri, Jun 06, 2014 at 06:21:02PM +0200, FX wrote:
> Hi all,
> 
> Our Fortran 2003 status page [1] says gfortran does not support "Kind type parameters of integer specifiers?. This item is defined thusly (item 4.9 in [2]):
> 
> > Some of the integer specifiers (e.g. NEXTREC) were limited to default kind in Fortran 95. Any kind of integer is permitted in Fortran 2003.
> 
> 
> I wanted to fix this, so I combed through the 95, 2003 and 2008 standards, and listed these changes. F2003 lifted all requirements on integer specifiers, and F2008 lifted requirements on logical specifiers. However, it appears that all of these are actually already handled in current trunk! So I?m proposing a simple two-fold action:
> 
>   - update the Fortran 2003 status to indicate our compliance
>   - commit the attached testcase (bootstrapped and regtested on x86_64-apple-darwin) which will make sure we stay that way.
> 
> OK?

This is OK with me.
diff mbox

Patch

Index: gfortran.dg/nondefault_int_kind.f90
===================================================================
--- gfortran.dg/nondefault_int_kind.f90	(revision 0)
+++ gfortran.dg/nondefault_int_kind.f90	(working copy)
@@ -0,0 +1,26 @@ 
+! { dg-do compile }
+!
+! Test our conformance to item 4.9 ("Kind type parameters of integer
+! specifiers") of the Fortran 2003 status document at
+! ftp://ftp.nag.co.uk/sc22wg5/N1551-N1600/N1579.pdf
+!
+! The non-default logical variables are allowed since Fortran 2008.
+
+  integer(kind=8) :: i, j, k, n
+  logical(kind=8) :: l1, l2, l3
+
+  open(unit=10, status="scratch", iostat=i)
+
+  backspace(10, iostat=i)
+  endfile(10, iostat=i)
+  rewind(10, iostat=i)
+
+  read(*, '(I2)', advance='no', iostat=i, size=j) k
+
+  inquire(iolength=i) "42"
+  inquire(10, iostat=i, number=j, recl=k, nextrec=n)
+  inquire(10, exist=l1, opened=l2, named=l3)
+
+  close(unit=10, iostat=i)
+
+end