ocaml-obuild/obuild — pull request #107 by planar (2014-09-06 16:30:36+00:00)
Title: fix invalid printf formats

There are some format strings that are "invalid" in the obuild sources.

In general, invalid formats are nonsensical format strings that were accepted in OCaml 4.01.0 and earlier, but whose semantics is unspecified. They are still accepted by the new Printf implementation of OCaml 4.02.0 but in some cases with different semantics, and they will be statically rejected by OCaml 4.03.0.

You can check for them in OCaml 4.02.0 with the flag -strict-formats.

In the case of obuild, it has formats of the form "%-.42s", which does not make sense (it would mean to print a string with 42 digits after the decimal point). In 4.01.0, it pads the string on the left, while in 4.02.0 it does no padding. In 4.02.1, it will pad on the left for compatibility with 4.01.0, but you should still take the opportunity to review the code and fix the format. The patch changes it to "%-42s", which recovers the previous behaviour, but that might still be wrong.