https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120107
Bug ID: 120107 Summary: -fc-prototypes for ISO_FORTRAN_ENV generates duplicate typedefs Product: gcc Version: 15.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: ryan.gambord at oregonstate dot edu Target Milestone: --- See terminal dump below. Looks like event/lock/team_type structs and typedefs are being emitted for every module in a source file. It broke my build system that uses a jinja template to generate several templated versions of a module within a single source file. $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) $cat test.f90 module a use, intrinsic :: ISO_FORTRAN_ENV end module a module b use, intrinsic :: ISO_FORTRAN_ENV end module b $gfortran -fc-prototypes -c -o test.o test.f90 #include <stddef.h> #ifdef __cplusplus #include <complex> #define __GFORTRAN_FLOAT_COMPLEX std::complex<float> #define __GFORTRAN_DOUBLE_COMPLEX std::complex<double> #define __GFORTRAN_LONG_DOUBLE_COMPLEX std::complex<long double> extern "C" { #else #define __GFORTRAN_FLOAT_COMPLEX float _Complex #define __GFORTRAN_DOUBLE_COMPLEX double _Complex #define __GFORTRAN_LONG_DOUBLE_COMPLEX long double _Complex #endif typedef struct event_type { } event_type; typedef struct lock_type { } lock_type; typedef struct team_type { } team_type; typedef struct event_type { } event_type; typedef struct lock_type { } lock_type; typedef struct team_type { } team_type; #ifdef __cplusplus } #endif