This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/77978] stop codes misinterpreted in both f2003 and f2008


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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to john.harper from comment #0)
> 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                                                             
> 

It actually worse than it appears.

% gfc7 -o z -std=f95 a.f90
% ./z
STOP -666666
% cat a.f90
  implicit none
  stop -666666
end program
% vi a.f90 (remove minus sign)
% gfc7 -o z -std=f95 a.f90
% ./z
STOP 666666

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]