[Patch, Fortran][RFC] Re-add libgfortran's c_f_procpointer (PR 38871)

Tobias Burnus burnus@net-b.de
Sat Jan 17 11:33:00 GMT 2009


Hi all,

when Chris added Bind(C) support he also included the libgfortran
function C_F_PROCPOINTER, which simply casted a pointer. As
procedure pointers were not supported back then, the function was
unused.

I removed the procedure from libgfortran after 4.3.0, when replacing
c_f_pointer (w/o SHAPE=) and c_f_procpointer with doing a proper
pointer assignment on tree level. As the first procedure pointer
patch was 2 months later, C_F_PROCPOINTER could not be used by
using "CALL C_F_PROCPOINTER" with procedure pointer arguments
(the "type(c_procptr)" data type existed but not the Fortran
proc pointer datatype).

Using the following program,

  use iso_c_binding
  type(c_ptr) :: fun
  integer, pointer :: bar
  call c_f_procpointer(fun,bar)
  end

one could call c_f_procpointer in 4.3 but the symbol generated was
      __iso_c_binding_c_f_procpointer_i4
which does never existed (only __iso_c_binding_c_f_procpointer existed).

Thus I still maintain what I wrote almost a year ago, when I submitted
the removal patch:

"As c_f_procpointer was never callable, I could remove it from the library."

Thus I believe one can close the bug as WONTFIX. Alternatively, one can
add the following patch, which re-adds the symbol.

Jakub, who has opened the P1 regression, writes there:
 "I'd say re-adding that symbol until you change libgfortran ABI wouldn't hurt
  anything, but if you can prove no program could ever use it except for
  referencing directly that symbol, I guess I can live with a WONTFIX too."

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readd-c_f_proc_pointer.diff
Type: text/x-patch
Size: 2234 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090117/84206571/attachment.bin>


More information about the Fortran mailing list