https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67467
Bug ID: 67467 Summary: Using "-Wall -Wextra -Wno-unused-dummy-argument" causes error Product: gcc Version: 5.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: exodus6395 at gmail dot com Target Milestone: --- Created attachment 36296 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36296&action=edit Simple test case with an unused argument Compiling a FORTRAN file which has an unused dummy argument using "-Wall -Wextra -Wno-unused-dummy-argument" causes a compiler error using gfortran 5.2.0. Using just two of the three options (-Wall, -Wextra and -Wno-unused-dummy-argument) causes the expected behaviour i.e. the code compiles with or without the warning as appropriate. However, using all three of them together causes the compilation to fail. Removing the code that generates the warning (eg using the variable a in the example code) lets it compile as normal. Example command line and output: [exodus@laptop-acer test-fortran]$ gfortran -c -o fortran.o -v -save-temps -Wall -Wextra -Wno-unused-dummy-argument unused-dummy-argument.f90 Using built-in specs. COLLECT_GCC=gfortran Target: x86_64-unknown-linux-gnu Configured with: /build/gcc/src/gcc-5.2.0/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release --with-default-libstdcxx-abi=gcc4-compatible Thread model: posix gcc version 5.2.0 (GCC) COLLECT_GCC_OPTIONS='-c' '-o' 'fortran.o' '-v' '-save-temps' '-Wall' '-Wextra' '-Wno-unused-dummy-argument' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/f951 fortran.f90 -quiet -dumpbase fortran.f90 -mtune=generic -march=x86-64 -auxbase-strip fortran.o -Wall -Wextra -Wno-unused-dummy-argument -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/finclude -o fortran.s GNU Fortran (GCC) version 5.2.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.2.0, GMP version 6.0.0, MPFR version 3.1.3-p4, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU Fortran2008 (GCC) version 5.2.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.2.0, GMP version 6.0.0, MPFR version 3.1.3-p4, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ‘ fortran.f90:7:0: END FUNCTION ^ in pp_format, at pretty-print.c:614 Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions.