You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6431 Reporter:@gasche Assigned to:@gasche Status: closed (set by @xavierleroy on 2015-12-11T18:27:54Z) Resolution: fixed Priority: normal Severity: minor Version: 4.02.0+dev Target version: 4.02.0+dev Category: standard library Duplicate of:#6447
Bug description
The %.3 handling of int conversions (fix_int_precision) is not robust enough.
Some case fail with assert failure:
Printf.printf "%.3x" (16*16-1);;
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 information
Spotted 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.
Original bug ID: 6431
Reporter: @gasche
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:27:54Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.0+dev
Target version: 4.02.0+dev
Category: standard library
Duplicate of: #6447
Bug description
The %.3 handling of int conversions (fix_int_precision) is not robust enough.
Printf.printf "%.3x" (16*16-1);;
Some case show a slight deviation of behavior wrt. legacy implementation (if we fix (1) above we may as well fix that)
Printf.printf "%#.6x" (16*16-1);;
0x00ff- : unit = ()
Printf.printf "%#.6x" (16*16-1);;
0x0000ff- : unit = ()
Additional information
Spotted 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.
File attachments
The text was updated successfully, but these errors were encountered: