This is the mail archive of the
mailing list for the GCC project.
Re: [gfortran] patch was: Re: Untabified and resubmitted: Patch togfortran PR13742
Victor Leikehman wrote:
The updated patch passes without complain the following (invalid) example:
COMMON /A/ X
REAL :: X = 12345
COMMON /A/ X
PRINT *, X
Now I'm embarassed. Looks like I messed up the check in decl.c after
verifying that it works ... I believe that in the version I posted the
error message in decl.c can never happen, and I had made sure that the
error triggers. The fix is to remove the check sym->value != NULL from
the hunk to decl.c. In order to save myself the embarassment of posting
another wrong patch, I would appreciate if you could check with this
correction, before I submit an updated patch.
I agree that this is a less severe problem than rejecting valid code.
Do you have any idea what is the rationale behind banning it?
I think the rationale is that COMMON is an old-style feature and should
only be used together with other old-style features, i.e. DATA. One
thing to note is the following from sec. 5.2.10:
Except for variables in named common blocks, a named variable [in a DATA
statement] has the SAVE attribute if any part of it is initialized in a
DATA statement, and this may be ...
Maybe they just didn't want to put exceptions all over the standard?