This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/17872] New: gfortran accepts 255_1 as integer constant
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2004 22:48:52 -0000
- Subject: [Bug fortran/17872] New: gfortran accepts 255_1 as integer constant
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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