Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006649OCamlstandard librarypublic2014-11-07 22:252016-03-21 17:14
Reporterberke.durak 
Assigned To 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version4.01.0 
Target Version4.03.0+dev / +beta1Fixed in Version4.03.0+dev / +beta1 
Summary0006649: int_of_string fails on integers starting with a +
DescriptionThe documentation states:

"Raise Failure "int_of_string" if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type int."

But starting an integer with a + is valid:

# let x = +1;;
val x : int = 1
Steps To Reproduce# int_of_string "+1";;
Exception: Failure "int_of_string".
Additional InformationScanf.sscanf "%d" accepts the +
TagsNo tags attached.
Attached Files

- Relationships
related to 0005829resolved int_of_string failure 
related to 0006296closed inconsistent behavior of float_of_string (compare to "ints"_of_string) 

-  Notes
(0012953)
doligez (administrator)
2014-12-22 23:04
edited on: 2014-12-22 23:04

Note that 0005936 will probably remove the +1 syntax from the language.

Since scanf uses the underlying C implementation, it's less likely to be "fixed" in the same way.

(0015381)
chrismamo1 (reporter)
2016-02-21 06:55

This seems to have bee resolved by PR#222 ( https://github.com/ocaml/ocaml/pull/222 [^] )
(0015563)
doligez (administrator)
2016-03-21 17:13

Indeed it was resolved by GPR#222. Thanks.

- Issue History
Date Modified Username Field Change
2014-11-07 22:25 berke.durak New Issue
2014-12-22 23:04 doligez Note Added: 0012953
2014-12-22 23:04 doligez Note Edited: 0012953 View Revisions
2014-12-22 23:04 doligez Status new => feedback
2015-01-10 00:18 doligez Target Version => 4.02.3+dev
2015-05-24 16:57 gasche Relationship added related to 0006316
2015-07-10 17:49 doligez Target Version 4.02.3+dev => 4.03.0+dev / +beta1
2015-07-25 09:06 xleroy Relationship added related to 0005829
2015-07-25 09:06 xleroy Relationship deleted related to 0006316
2015-07-25 09:07 xleroy Relationship added related to 0006296
2016-02-21 06:55 chrismamo1 Note Added: 0015381
2016-03-21 17:13 doligez Note Added: 0015563
2016-03-21 17:14 doligez Status feedback => closed
2016-03-21 17:14 doligez Resolution open => fixed
2016-03-21 17:14 doligez Fixed in Version => 4.03.0+dev / +beta1
2017-02-23 16:43 doligez Category OCaml standard library => standard library


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker