------- Comment #6 from aldot at gcc dot gnu dot org 2006-10-22 11:50 ------- > I think the code in comment #1 is valid.
Rejecting blank common in block data stmts would add a regression in testsuite's blockdata_1.f90 like so: [EMAIL PROTECTED]:~/src/gcc-4.2/gcc/testsuite/gfortran.dg$ gfortran-4.2-HEAD -S -o foo.s -W -Wall blockdata_1.f90 In file blockdata_1.f90:17 common j 1 Error: BLOCK DATA unit cannot contain blank COMMON at (1) In file blockdata_1.f90:18 data j /1/ 1 Error: BLOCK DATA element 'j' at (1) must be in COMMON So rejecting the blank common must be wrong, fwiw :) --- match.c (revision 117934) +++ match.c (working copy) @@ -2327,16 +2328,20 @@ gfc_match_common (void) if (name[0] == '\0') { + if (gfc_current_ns->is_block_data) + { + gfc_error ("BLOCK DATA unit cannot contain blank COMMON at %C"); + goto cleanup; + } t = &gfc_current_ns->blank_common; if (t->head == NULL) t->where = gfc_current_locus; - head = &t->head; } else { t = gfc_get_common (name, 0); - head = &t->head; } + head = &t->head; if (*head == NULL) tail = NULL; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29537