[Patch, Fortran] Fix PR 24878, checking actual arguments against global symbols

Thomas Koenig tkoenig@netcologne.de
Sat Feb 8 14:31:23 GMT 2025


Hello world,

this fixes a rather old PR from 2005, where a subroutine
could be passed and called as a function.  This patch checks
for that, also for the reverse, and for wrong types of functions.

I expect that this will find a few bugs in dusty deck code...

Regression-tested. OK for trunk?

Best regards

	Thomas

Test procedure dummy arguments against global symbols, if available.

gcc/fortran/ChangeLog:

	PR fortran/24878
	* interface.cc (compare_parameter): Check global subroutines
	passed as actual arguments for subroutine / function and
	function type.

gcc/testsuite/ChangeLog:

	PR fortran/24878
	* gfortran.dg/interface_51.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p-interface.diff
Type: text/x-patch
Size: 3826 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20250208/3710a9e2/attachment.bin>


More information about the Fortran mailing list