Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003582OCamlOCaml generalpublic2005-04-06 18:002013-09-03 13:36
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003582: (1073741824 = -1073741824) is true !
DescriptionFull_Name: Thomas de Grivel
Version: 3.08.2
OS: debian
Submission from: robinson-2-82-67-155-88.fbx.proxad.net (82.67.155.88)


The integer literal 1073741824 is accepted even if it is outside the range of
representable integers.

In the ocaml 3.08.2 toplevel:

# 1073741824;;
- : int = -1073741824

# 1073741824 = -1073741824;;
- : bool = true


It really should fail just like it's successor :

# 1073741825;;
Integer literal exceeds the range of representable integers of type int

TagsNo tags attached.
Attached Files

- Relationships
related to 0003302closed Int64.of_string does not detect overflow from positive to negative ints 
related to 0004210closedxleroy little bug in int_of_string 

-  Notes
(0000254)
administrator (administrator)
2005-04-17 11:09

See PR#3302. Obvious fix causes problems with the way integer literals are
parsed.
(0010027)
dsheets (reporter)
2013-07-30 23:30

Should be closed by PR#4210?

xleroy says < http://caml.inria.fr/mantis/view.php?id=4210#c5024 [^] > that the lexer still gives erroneous results but it is not clear why this double negation trick is necessary.
(0010302)
doligez (administrator)
2013-09-03 13:36

As of 4.00.1, the behaviour is still there, and it's unlikely to ever be changed.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2008-01-22 17:04 doligez Relationship added related to 0003302
2013-07-30 23:30 dsheets Note Added: 0010027
2013-09-03 13:33 doligez Relationship added related to 0004210
2013-09-03 13:36 doligez Note Added: 0010302


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker