This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] PR13910 Old-style initialization of LOGICAL variables
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 15 May 2004 01:13:20 +0100
- Subject: Re: [gfortran] PR13910 Old-style initialization of LOGICAL variables
- Organization: CodeSourcery
- References: <40A12CED.70202@physik.uni-muenchen.de>
On Tuesday 11 May 2004 20:43, Tobias Schlüter wrote:
> This adds a very restricted language extension.
We should also provide user-level documentation of extensions like this.
> Bud reported that it is commonplace in some codes to initialize LOGICALs
> as follows:
> LOGICAL L / .TRUE. /
I don't think your implementation is correct.
I would expect this extension to follow the same rules as a DATA statement.
ie.
integer a, b /2 * 42/
should be equivalent to
integer a, b
data a, b /2 * 42/
and not
integer :: a, b = 84
g77 goes halfway. It rejects my example, but allows the following:
integer a, b /42/, c /3/
as equivalent to
integer :: a, b = 42, c = 3
I'll let you decide which you want to implement.
> This patch allows this, if we're compiling with STD_GNU. Compile
> testcase attached.
The testcase (which I don't see attached ;) should be an execute test that
verifies that proper initialization has occurred.
> + if (m == MATCH_YES && pedantic)
Pedantic is not right here. This is a clear extension, not a slight bending of
rules:)
Paul