https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120470

            Bug ID: 120470
           Summary: gfortran -Wexternal-argument-mismatch produces compile
                    error on valid code
           Product: gcc
           Version: 15.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: albert at tugraz dot at
  Target Milestone: ---

Created attachment 61545
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61545&action=edit
Minimal reproducible example

gcc version 15.1.1 20250425 (GCC) on Arch Linux

$ gfortran -Wexternal-argument-mismatch -c issue.f90

fails with 

issue.f90:18:19:

   18 |         call inner(proc)
      |                   1
Error: Interface mismatch in dummy procedure ‘proc’ at (1): Shape mismatch in
argument 'x'

The error is also triggered by `-Wall` and disappears when
`-Wexternal-argument-mismatch` is not included in a set of flags. Expected
behavior would be warnings only (if applicable), not an error.

Version 14.2.1 20250207 that doesn't support `-Wexternal-argument-mismatch`
works fine with `-Wall`, and throws only an "unused dummy argument" warning. 

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/15.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust,cobol
--enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues
--with-build-config=bootstrap-lto --with-linker-hash-style=gnu
--with-system-zlib --enable-__cxa_atexit --enable-cet=auto
--enable-checking=release --enable-clocale=gnu --enable-default-pie
--enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object
--enable-libstdcxx-backtrace --enable-link-serialization=1
--enable-linker-build-id --enable-lto --enable-multilib --enable-plugin
--enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.1 20250425 (GCC)

Reply via email to