[Patch, Fortran] PR33310, PR33284: Add conflicts between PARAMETER and Bind(C); between ENTRY and INTRINSIC

Tobias Burnus burnus@net-b.de
Wed Sep 5 13:59:00 GMT 2007


:ADDPATCH fortran:

Currently,
  INTEGER, PARAMETER, BIND(C) :: bar = 5
is accepted (in the specification part of a module). However, this does
not make sense as "bar" is no variable.

>From the Fortran standard:

"The BIND attribute for a variable or common block specifies that it is
capable of interoperating with a C variable that has external linkage
(15.3)."

I would argue that a symbol with a PARAMETER attribute is not a
"variable" but a "named constant" and thus BIND(C) is invalid.

 * * *

SUBROUTINE a
 intrinsic  cos
entry cos(x)
 real x
 x = 0
end subroutine


is accepted. I did not verify this in the standard, but I sincerely
doubt that a symbol can be both an intrinsic procedure and an entry
(procedure). Additionally, ifort and NAG f95 agree that this is
invalid.  (ENTRY already conflicts with external, subroutine, procedure,
function.)

Build and regression tested on x86_64-unknown-linux-gnu with no
regressions (ignoring the failues at -O3 [c_char_tests.f03 and do_3.F90].)
OK for the trunk?

Tobias



More information about the Fortran mailing list