pgfortran does not accept bind(c,name='')

pgfortran 17.10 incorrectly rejects the following program unit.

subroutine s() bind(c,name='')
end subroutine s



file.s: Assembler messages:
file.s:58: Error: expected symbol name
file.s:71: Error: Missing symbol name in directive
file.s:72: Warning: missing operand; zero assumed
file.s:113: Warning: missing operand; zero assumed
file.s: Error: .size expression for does not evaluate to a constant

Thanks for the report. bind(c,’’) does not work with a blank.

Workaround is to use a non-blank bind C name.

Also important to add

use ISO_C_BINDING

statement in the source as well, but gfortran and ifort
did not seem to mind.

TPR 24945.

dave

Why is it important to add “use iso_c_binding” in this case? The program unit does not attempt to access any entities from that module.

You are correct. Just makes programming clearer to others
reading it.