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: 4204 Reporter:@dra27 Assigned to:@pierreweis Status: closed (set by @damiendoligez on 2008-09-11T11:58:59Z) Resolution: fixed Priority: normal Severity: major Version: 3.09.3 Fixed in version: 3.11+dev Category: ~DO NOT USE (was: OCaml general) Duplicate of:#3992 Monitored by: "Hendrik Tews"
Bug description
Positional specifiers do not work as indicated in the documentation for Printf. Specifically, the example given "For instance, %.*3$f prints a float with as many fractional digits as the value of the third argument." gives the following response in the toploop:
Printf.printf "%.*3$f";;
Characters 14-22:
Printf.printf "%.*3$f";;
rather than int -> float -> unit!
Additional information
I'm assuming that this is a code bug rather than a docs bug if Printf aims to be POSIX compliant.
The text was updated successfully, but these errors were encountered:
This a bug in the type-checking of format strings. This is not so easy to fix, and need a rather drastic modification of the routine that type-checks format strings. This is on the TODO list for the next version.
In the mean time, a quick fix could be to suppress positional specifiers from the documentation of format strings :)
Original bug ID: 4204
Reporter: @dra27
Assigned to: @pierreweis
Status: closed (set by @damiendoligez on 2008-09-11T11:58:59Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.09.3
Fixed in version: 3.11+dev
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #3992
Monitored by: "Hendrik Tews"
Bug description
Positional specifiers do not work as indicated in the documentation for Printf. Specifically, the example given "For instance, %.*3$f prints a float with as many fractional digits as the value of the third argument." gives the following response in the toploop:
Printf.printf "%.*3$f";;
Characters 14-22:
Printf.printf "%.*3$f";;
rather than int -> float -> unit!
Additional information
I'm assuming that this is a code bug rather than a docs bug if Printf aims to be POSIX compliant.
The text was updated successfully, but these errors were encountered: