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/17872] New: gfortran accepts 255_1 as integer constant


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


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