aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cerrors.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-10-26 13:00:45 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-10-26 13:00:45 +0100
commit51b059d9a5559cf06e13e82bcda3da9f1c70fad1 (patch)
treed2060251ae147a565e2d6297666effc5fe7fa7a0 /cparser/Cerrors.ml
parent94163429293cef7410320f79fc5964fc546fccef (diff)
parent52c4f2622a32a88f9470111542b547514e6b21cc (diff)
downloadcompcert-51b059d9a5559cf06e13e82bcda3da9f1c70fad1.tar.gz
compcert-51b059d9a5559cf06e13e82bcda3da9f1c70fad1.zip
Merge branch 'fpottier-clean'
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