http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45044
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-30 21:33:18 UTC --- I was thinking of using: gfc_gsymbol *gsym; gsym = gfc_get_gsymbol (com->name); gcc_assert (gsym->type == GSYM_COMMON); gfc_warning ("Named COMMON block '%s' at %L shall be of the " "same size as at %L (%lu vs %lu bytes)", com->name, &com->where, &gsym->where, But that won't work reliably: a) The byte size changes, while the position of (2) remains the same, e.g: Warnung: Named COMMON block 'xx' at (1) shall be of the same size as at (2) (24 vs 4 bytes) Warnung: Named COMMON block 'xx' at (1) shall be of the same size as at (2) (8 vs 24 bytes) b) One get's even strange results if one has 4 bytes, 30 bytes, 4 bytes as then (1) and (2) have the same bytes size but the error message claims that one is 4 and the other is 30 bytes wide. I defer this and now only print the byte-size, cf. http://gcc.gnu.org/ml/fortran/2011-08/msg00254.html