This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] PR13910 Old-style initialization of LOGICAL variables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]