[gfortran] PR13910 Old-style initialization of LOGICAL variables
Paul Brook
paul@codesourcery.com
Sat May 15 03:01:00 GMT 2004
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
More information about the Gcc-patches
mailing list