aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cerrors.ml
diff options
context:
space:
mode:
authorJacques-Henri Jourdan <jacques-henri.jourdan@inria.fr>2015-11-04 03:04:21 +0100
committerJacques-Henri Jourdan <jacques-henri.jourdan@inria.fr>2015-11-04 03:04:21 +0100
commit5664fddcab15ef4482d583673c75e07bd1e96d0a (patch)
tree878b22860e69405ba5cf6fd2798731dac8ce660c /cparser/Cerrors.ml
parentb960c83725d7e185ac5c6e3c0d6043c7dcd2f556 (diff)
parentfe73ed58ef80da7c53c124302a608948fb190229 (diff)
downloadcompcert-5664fddcab15ef4482d583673c75e07bd1e96d0a.tar.gz
compcert-5664fddcab15ef4482d583673c75e07bd1e96d0a.zip
Merge remote-tracking branch 'origin/master' into parser_fix
Diffstat (limited to 'cparser/Cerrors.ml')
-rw-r--r--cparser/Cerrors.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml
index 23ec1710..5c077f37 100644
--- a/cparser/Cerrors.ml
+++ b/cparser/Cerrors.ml
@@ -26,6 +26,18 @@ let reset () = num_errors := 0; num_warnings := 0
exception Abort
+(* [fatal_error_raw] is identical to [fatal_error], except it uses [Printf]
+ to print its message, as opposed to [Format], and does not automatically
+ introduce indentation and a final dot into the message. This is useful
+ for multi-line messages. *)
+
+let fatal_error_raw fmt =
+ incr num_errors;
+ Printf.kfprintf
+ (fun _ -> raise Abort)
+ stderr
+ (fmt ^^ "Fatal error; compilation aborted.\n%!")
+
let fatal_error fmt =
incr num_errors;
kfprintf