http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55444
Bug #: 55444
Summary: Rejects valid code with USE ISO_C_BINDING in BLOCK
DATA
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
Reported by at Henrik Holst
athttps://groups.google.com/forum/?fromgroups=#!topic/comp.lang.fortran/aOMi2iZ-2c8
The following program prints bogus errors of the form:
USE ISO_C_BINDING ! FAILS
1
Error: INTENT attribute not allowed in BLOCK DATA program unit at (1)
Error: EXTERNAL attribute not allowed in BLOCK DATA program unit at (1)
BLOCKDATA
! USE ISO_C_BINDING, ONLY: C_INT, C_FLOAT ! WORKS
USE :: ISO_C_BINDING ! FAILS
INTEGER(C_INT) X
REAL(C_FLOAT) Y
COMMON /FOO/ X,Y
BIND(C,NAME='fortranStuff') /FOO/
DATA X /1/
DATA Y /2.0/
END BLOCKDATA
* * *
The message is printed in check_conflict where the following is true:
if (gfc_current_state () == COMP_BLOCK_DATA)
The caller is resolve_contained_functions – the question is why the symbols end
up there (seemingly also "functions" like "c_backspace" of flavour parameter)?
The message is printed for the SHAPE= argument of c_f_pointer.