Bug 2366511 - Gfortran fails to compile standards compliant code when -Wall is enabled
Summary: Gfortran fails to compile standards compliant code when -Wall is enabled
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 45
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2366480
TreeView+ depends on / blocked
 
Reported: 2025-05-15 14:06 UTC by Susi Lehtola
Modified: 2026-08-17 13:36 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
Source code from dftd4 which exhibits the crash (10.37 KB, text/plain)
2025-05-15 14:06 UTC, Susi Lehtola
no flags Details

Description Susi Lehtola 2025-05-15 14:06:02 UTC
dftd4 and mctc-lib fail to compile in rawhide with gcc-gfortran-15.1.1-1.fc43 with an "Interface mismatch" error:

../app/argument.f90:114:53:

  114 |       call make_argument_list(new, argument_counter, argument_getter)
      |                                                     1
Error: Interface mismatch in dummy procedure ‘argument_getter’ at (1): ALLOCATABLE mismatch in argument '_formal_1'
../app/argument.f90:116:59:

  116 |       call make_argument_list(new, default_argument_count, get_default_argument)
      |                                                           1
Error: Interface mismatch in dummy procedure ‘argument_getter’ at (1): ALLOCATABLE mismatch in argument '_formal_1'


The codes in question use procedure pointers, which have been supported in at least four Fortran compilers for years. The error is only triggered when -Wall is present in the compiler flags.

<mock-chroot> sh-5.2# gfortran -c ../app/argument.f90
<mock-chroot> sh-5.2# gfortran -c -Wall ../app/argument.f90
../app/argument.f90:114:53:

  114 |       call make_argument_list(new, argument_counter, argument_getter)
      |                                                     1
Error: Interface mismatch in dummy procedure ‘argument_getter’ at (1): ALLOCATABLE mismatch in argument '_formal_1'
../app/argument.f90:116:59:

  116 |       call make_argument_list(new, default_argument_count, get_default_argument)
      |                                                           1
Error: Interface mismatch in dummy procedure ‘argument_getter’ at (1): ALLOCATABLE mismatch in argument '_formal_1'


I do not have a reduced test case, but the attached file from dftd4 is 364 lines and has no dependencies. The same codes compile in Fedora 41 and 40 without issues.

Reproducible: Always

Steps to Reproduce:
1. gfortran -c -Wall argument.f90

Actual Results:
Code does not compile

Expected Results:
Code compiles

Comment 1 Susi Lehtola 2025-05-15 14:06:45 UTC
Created attachment 2089964 [details]
Source code from dftd4 which exhibits the crash

Comment 2 Jonathan Wakely 2025-05-15 14:11:28 UTC
See https://gcc.gnu.org/gcc-15/changes.html#fortran

"The -Wexternal-arguments-mismatch option has been added. This checks for mismatches between the argument lists in dummy external arguments, and is implied by -Wall and -fc-prototypes-external options."

Comment 3 Aoife Moloney 2026-08-17 13:36:46 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.


Note You need to log in before you can comment on or make changes to this bug.