From patchwork Fri Jun 6 16:21:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: FX Coudert X-Patchwork-Id: 356926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 24F3F1400E4 for ; Sat, 7 Jun 2014 02:21:18 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:subject:date:message-id:cc:to:mime-version; q=dns; s=default; b=Ijdlrjo6JY8ull/UfjzW2HqJQatIDWTXlGWrcOMipCH+/RssqS nHzdL3IFL190ihhlO+Y632BV1m7LTUyzwKotLshLcTLRhVXdcMmtnUJUHFnefMy8 U0RqgoudYUPA9/fmQX9MlCbP/feBCYFaZf/99yBdm5QNZRCuvP8r+oOfU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:subject:date:message-id:cc:to:mime-version; s= default; bh=ncXbHlHd+meXCwDBcxw+ldnKiws=; b=xpPD25y/f2U+Iod1QGJp 51wy6N702hZUgGCfQtTWjpR0EQSjcRaFypW/LEzukdNCuhE48Lxn7sFHH15uidVn nqBFtH6mJoEPIcvjRf551FlmHTHwvv3krK8BuVjJb6m/G3Hzxgp9ASMmejpq4Ngg iK00XQ50kgM9roD2CyZEp3M= Received: (qmail 29098 invoked by alias); 6 Jun 2014 16:21:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29078 invoked by uid 89); 6 Jun 2014 16:21:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-we0-f181.google.com Received: from mail-we0-f181.google.com (HELO mail-we0-f181.google.com) (74.125.82.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 06 Jun 2014 16:21:08 +0000 Received: by mail-we0-f181.google.com with SMTP id w61so3113623wes.12 for ; Fri, 06 Jun 2014 09:21:05 -0700 (PDT) X-Received: by 10.194.80.161 with SMTP id s1mr8496188wjx.47.1402071665457; Fri, 06 Jun 2014 09:21:05 -0700 (PDT) Received: from [192.168.100.3] (chp127.enscp.fr. [193.51.253.127]) by mx.google.com with ESMTPSA id fq2sm22172443wib.2.2014.06.06.09.21.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 09:21:04 -0700 (PDT) From: FX Subject: [fortran, patch] F2003 "non-default kind specifiers" compliance Date: Fri, 6 Jun 2014 18:21:02 +0200 Message-Id: <05D8E558-7941-41F0-B02B-D7D94BB0ABF8@gmail.com> Cc: gcc-patches To: gfortran Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) 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 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