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/30528] INTEGER(2) overflow



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-01-21 20:14 -------
First, it should be noted that it's not legal code. Indeed, you might (or not)
be surprised by the behaviour of the code in question:

pito /tmp $ cat a.f 
      INTEGER*2 IWD1
      IWD1 = 32768
      PRINT *, IWD1
      END
pito /tmp $ g77 a.f && ./a.out
 -32768

This check is new in gfortran, the behaviour is intentional but can be
specificaly disabled using -fno-range-check:

$ gfortran -fno-range-check a.f && ./a.out
 -32768


Closing bug report as INVALID. Making note to document this in the release
notes.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
  GCC build triplet|powerpc-apple-darwin8       |
   GCC host triplet|powerpc-apple-darwin8       |
 GCC target triplet|powerpc-apple-darwin8       |
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30528


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