From f02f00a01b598567f70e138c144d9581973802e6 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 8 Feb 2018 16:38:54 +0100 Subject: Refactor the handling of errors and warnings (#44) * Module Cerrors is now called Diagnostic and can be used in parts of CompCert other than cparser/ * Replaced eprintf error. Instead of having eprintf msg; exit 2 use the functions from the Diagnostics module. * Raise on error before calling external tools. * Added diagnostics to clightgen. * Fix error handling of AsmToJson. * Cleanup error handling of Elab and C2C. *The implementation of location printing (file & line) is simplified and correctly prints valid filenames with invalid lines. --- driver/Driveraux.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'driver/Driveraux.mli') diff --git a/driver/Driveraux.mli b/driver/Driveraux.mli index 51333b2a..6f0eaddb 100644 --- a/driver/Driveraux.mli +++ b/driver/Driveraux.mli @@ -16,7 +16,7 @@ val command: ?stdout:string -> string list -> int (** Execute the command with the given arguments and an optional file for the stdout. Returns the exit code. *) -val command_error: string -> int -> unit +val command_error: string -> int -> 'a (** Generate an error message for the given command and exit code *) val safe_remove: string -> unit @@ -38,7 +38,7 @@ val output_filename_default: string -> string val ensure_inputfile_exists: string -> unit (** Test whether the given input file exists *) -val print_error:out_channel -> Errors.errcode list -> unit +val print_error:Format.formatter -> Errors.errcode list -> unit (** Printing of error messages *) val explode_comma_option: string -> string list -- cgit