public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/17872] New: gfortran accepts 255_1 as integer constant
@ 2004-10-06 22:48 tobi at gcc dot gnu dot org
  2004-10-07  1:59 ` [Bug fortran/17872] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-10-06 22:48 UTC (permalink / raw)
  To: gcc-bugs

the following compiles without error:
integer*1 :: i1 = 255_1
integer*2 :: i2 = 65535_2
end

we're using signed integers, so this shouldn't happen. the reason is that
gfc_check_integer_range compares the integer against
gfc_integer_kinds[i].max_int which is 255 for kind 1, etc. not
gfc_integer_kinds[i].huge, which is 127 for kind 1 etc.

Changing this might break boz constants (e.g. z'ffffffff'), this has to be
investigated when creating a patch.

-- 
           Summary: gfortran accepts 255_1 as integer constant
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: minor
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobi at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/17872] gfortran accepts 255_1 as integer constant
  2004-10-06 22:48 [Bug fortran/17872] New: gfortran accepts 255_1 as integer constant tobi at gcc dot gnu dot org
@ 2004-10-07  1:59 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-07  1:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-07 01:59 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-07 01:59:16
               date|                            |


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/17872] gfortran accepts 255_1 as integer constant
       [not found] <bug-17872-8513@http.gcc.gnu.org/bugzilla/>
@ 2006-10-23 19:07 ` fxcoudert at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-10-23 19:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2006-10-23 19:07 -------
Fixed on 4.2 branch and probably earlier:

 In file a.f90:1

integer*1 :: i1 = 255_1
                      1
Error: Integer too big for its kind at (1)
 In file a.f90:2

integer*2 :: i2 = 65535_2
                        1
Error: Integer too big for its kind at (1)


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.2.0


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-23 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-06 22:48 [Bug fortran/17872] New: gfortran accepts 255_1 as integer constant tobi at gcc dot gnu dot org
2004-10-07  1:59 ` [Bug fortran/17872] " pinskia at gcc dot gnu dot org
     [not found] <bug-17872-8513@http.gcc.gnu.org/bugzilla/>
2006-10-23 19:07 ` fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).