From 675cfeb56c1d8dbf74107cb067adbf33275d8f31 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 16 Feb 2016 14:26:29 -0800 Subject: [PATCH] Enable -strict-formats Summary:public Rejects malformed format strings. Reviewed By: jvillard Differential Revision: D2938247 fb-gh-sync-id: bc731b3 shipit-source-id: bc731b3 --- infer/src/Makefile.in | 1 + infer/src/backend/inferprint.ml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index d4c9c99a0..9e389c78f 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -78,6 +78,7 @@ OCAMLBUILD_OPTIONS = \ $(OCAMLBUILD_QUIET_OPTIONS) \ -classic-display \ -cflags -principal \ + -cflags -strict-formats \ -cflags -w,@5 \ -cflags -w,@8 \ -cflags -w,@10 \ diff --git a/infer/src/backend/inferprint.ml b/infer/src/backend/inferprint.ml index d757170db..96cb2055c 100644 --- a/infer/src/backend/inferprint.ml +++ b/infer/src/backend/inferprint.ml @@ -852,7 +852,8 @@ module Stats = struct | None -> "" in let line = let pp fmt () = - if description <> "" then F.fprintf fmt "%s%04s // %s@\n" (indent_string (level + indent_num)) " " description; + if description <> "" + then F.fprintf fmt "%s%4s // %s@\n" (indent_string (level + indent_num)) " " description; F.fprintf fmt "%s%04d: %s" (indent_string (level + indent_num)) loc.Location.line code in pp_to_string pp () in res := line :: "" :: !res in