Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005121OCamlOCaml generalpublic2010-08-03 17:222013-04-24 17:00
Reporterkhooyp 
Assigned Toweis 
PriorityhighSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.11.2 
Target Version4.00.2+devFixed in Version 
Summary0005121: %( %) in Format module seems to be broken
DescriptionComparing the Printf module vs. the Format module:

# Printf.printf "111 %(%d%) 222%!" "%d" 3;;
111 3 222- : unit = ()

# Format.printf "111 %(%d%) 222%!" "%d" 3;;
111 - : unit = <unknown constructor>

This seems to happen if %( %) encloses any format specifier.
TagsNo tags attached.
Attached Filesdiff file icon format_5121.diff [^] (2,228 bytes) 2011-12-27 19:10 [Show Content]

- Relationships

-  Notes
(0006542)
sliquister (reporter)
2011-12-27 19:07

I attached a patch on the current head that solves the issue.
cont_m in Format.mkprintf was wrongly computing the indexes in the array of values.
(0009202)
weis (developer)
2013-04-24 17:00

Thanks again for the bug report and the patch. I did a big cleaning in the code to get rid of the bug, as well as suppress irrelevant differences between Printf and Format codes for function mk_printf.

I will add your example to the test suite for the module Format.

- Issue History
Date Modified Username Field Change
2010-08-03 17:22 khooyp New Issue
2010-08-19 15:06 weis Assigned To => weis
2010-08-19 15:06 weis Status new => assigned
2011-12-27 19:07 sliquister Note Added: 0006542
2011-12-27 19:10 sliquister File Added: format_5121.diff
2012-07-10 19:59 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-19 13:49 doligez Target Version 4.00.1+dev => 4.00.2+dev
2012-09-19 13:57 doligez Priority normal => high
2013-04-24 17:00 weis Note Added: 0009202
2013-04-24 17:00 weis Status assigned => resolved
2013-04-24 17:00 weis Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker