Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006431OCamlOCaml standard librarypublic2014-05-18 22:272014-06-04 22:20
Reportergasche 
Assigned Togasche 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.02.0+dev 
Target Version4.02.0+devFixed in Version 
Summary0006431: Printf: precision qualifiers sometime result in assert failure
DescriptionThe %.3 handling of int conversions (fix_int_precision) is not robust enough.

1) Some case fail with assert failure:

  # Printf.printf "%.3x" (16*16-1);;

2) Some case show a slight deviation of behavior wrt. legacy implementation (if we fix (1) above we may as well fix that)

        OCaml version 4.02.0+dev6-2014-05-12
  # Printf.printf "%#.6x" (16*16-1);;
  0x00ff- : unit = ()

        OCaml version 4.01.0
  # Printf.printf "%#.6x" (16*16-1);;
  0x0000ff- : unit = ()
Additional InformationSpotted by 'Anarchos' by compiling coq-trunk.

Note that it would be helpful to make the few "assert false" in the runtime code for printf/format/scanf more descriptive (print a decent error message with the problematic format) so that users that would find on a bug of the implementation send helpful bugreports.
TagsNo tags attached.
Attached Filespatch file icon bug-6431-6447.patch [^] (444 bytes) 2014-06-04 21:49 [Show Content]

- Relationships
duplicate of 0006447resolvedgasche The behavior of formats in printf changed 

-  Notes
(0011657)
bvaugon (developer)
2014-06-04 21:47

Equivalent to bug report 0006447.

Fixed by the attached patch.
(0011663)
gasche (developer)
2014-06-04 22:20

Merged in trunk and 4.02. Thanks!

- Issue History
Date Modified Username Field Change
2014-05-18 22:27 gasche New Issue
2014-05-18 22:27 gasche Status new => assigned
2014-05-18 22:27 gasche Assigned To => gasche
2014-05-18 22:28 gasche Description Updated View Revisions
2014-05-18 22:28 gasche Additional Information Updated View Revisions
2014-06-04 21:47 bvaugon Note Added: 0011657
2014-06-04 21:49 bvaugon File Added: bug-6431-6447.patch
2014-06-04 22:20 gasche Note Added: 0011663
2014-06-04 22:20 gasche Status assigned => resolved
2014-06-04 22:20 gasche Resolution open => fixed
2014-06-04 22:20 gasche Relationship added duplicate of 0006447


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker