This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/85575] Acceptance of invalid code: ordering of declaration statements with implicit typing
- From: "juergen.reuter at desy dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 May 2018 16:30:43 +0000
- Subject: [Bug fortran/85575] Acceptance of invalid code: ordering of declaration statements with implicit typing
- Auto-submitted: auto-generated
- References: <bug-85575-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85575
--- Comment #10 from Jürgen Reuter <juergen.reuter at desy dot de> ---
(In reply to Dominique d'Humieres from comment #9)
> AFAICT
>
> (1) The behavior is present even without module: add
>
> implicit none
> integer :: cl
>
> to the test in comment 4 and it compiles if -std=f* is not used.
>
> (2) The extension seems to "work" as expected.
>
> (3) The extension is not documented.
>
> How do you expect this PR to be fixed?
>
> (a) Remove the extension (beware benchmarks).
> (b) Limit it to codes compiled with -std=legacy.
> (c) Document it.
> ...
Tough question. Documentation never hurts, so probably yes. Now that you
mentioned that this also works for external functions, I would suppose this was
for backwards compatibility with code developed with g77. I would prefer
gfortran to follow the standard and throw an error without restricting to
-std=fXXXX, and allow the extension only for -std=legacy. But I feel that this
is the responsibility of the developer team to decide on the policy.