https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77978
Bug ID: 77978 Summary: stop codes misinterpreted in both f2003 and f2008 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: john.harper at vuw dot ac.nz Target Milestone: --- Stop codes changed from the f2003 standard to f2008. The first of these 2 programs has a stop code valid in f2003 but not in f2008, the second has a stop code valid in f2008 but not in f2003. But gfortran 6.1.1 happily compiles and runs both programs with either -std=f2003 or -f2008. Here are the program listings, gfortran -v result, and the results of compiling with the -std options that should not have worked: cayley[~/Jfh] % cat stopnumber.f90 ! stop666 (no space before 666) is valid f95 or f2003 but bad f2008 implicit none stop666 end program cayley[~/Jfh] % cat stopnumber2.f90 ! stop expression is valid f2008 but bad f2003 implicit none stop merge(667,668,.true.) end program cayley[~/Jfh] % gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/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 Thread model: posix gcc version 6.1.1 20160602 (GCC) cayley[~/Jfh] % gfortran -std=f2008 stopnumber.f90 cayley[~/Jfh] % ./a.out STOP 666 cayley[~/Jfh] % gfortran -std=f2003 stopnumber2.f90 cayley[~/Jfh] % ./a.out STOP 667 cayley[~/Jfh] %