This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran,patch] add ISO_FORTRAN_ENV intrinsic module
- From: Tobias Burnus <burnus at net-b dot de>
- Cc: François-Xavier Coudert <fxcoudert at gmail dot com>, GFORTRAN <fortran at gcc dot gnu dot org>, GCC-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 04 Nov 2006 14:43:51 +0100
- Subject: Re: [gfortran,patch] add ISO_FORTRAN_ENV intrinsic module
- References: <19c433eb0610260602g64e3c003s6f9a9dcbd1fddc6f@mail.gmail.com> <45466774.6020509@wanadoo.fr> <A8F0D5CC-C2FB-4DE0-A77A-9A606A025CE0@gmail.com> <19c433eb0611030119o5a91dc83k72ac8fb56d86c0f1@mail.gmail.com> <454C90D2.6080805@net-b.de>
Hi,
Tobias Burnus wrote:
> Maybe one should give a better error message for:
>
> use, intrinsic iso_fortran_env
> 1
> Error: Unclassifiable statement at (1)
>
> This usage is invalid in Fortran 2003, however g95, NAG f95 and ifort
> accept this and if it works with several compilers and you see this
> message with the gfortran, you may wrongly assume either that gfortran
> has a bug or does not support (non_)intrinsic.
> Suggested fix: Accept it with -std=gnu, reject it with a nice error with
> -std=f2003.
>
Just for completeness: I filled bugreports for g95, NAG f95 and ifort to
give at least a warning (with -std=f2003, -f2003, -stand f03) and I
tested with sunf95:
use,intrinsic iso_fortran_env,only: stdErr => error_unit
^
"iso_const.f90", Line = 2, Column = 16: ERROR: Unexpected syntax: "::"
was expected but found "I".
I'm still unsure whether one should accept it with -std=gnu or reject it
always?
sunf95 also gives a (default) warning which we might also want to give:
If a module exists as intrinsic and as non_intrinsic module, sunf95 writes:
use iso_fortran_env,only: stdErr => error_unit
^
"iso_const.f90", Line = 2, Column = 6: WARNING: This name of
nonintrinsic module may disguise the name of intrinsic module
ISO_FORTRAN_ENV
I don't know whether we want to follow suit (default warning or only
with a -W* option).
Tobias