diff options
Diffstat (limited to 'cparser/Cerrors.mli')
-rw-r--r-- | cparser/Cerrors.mli | 59 |
1 files changed, 53 insertions, 6 deletions
diff --git a/cparser/Cerrors.mli b/cparser/Cerrors.mli index 313573c3..b547188a 100644 --- a/cparser/Cerrors.mli +++ b/cparser/Cerrors.mli @@ -13,13 +13,60 @@ (* *) (* *********************************************************************) -val warn_error : bool ref +(* Printing of warnings and error messages *) + val reset : unit -> unit + (** Reset the error counters. *) + exception Abort -val fatal_error_raw : ('a, out_channel, unit, 'b) format4 -> 'a -val fatal_error : ('a, Format.formatter, unit, unit, unit, 'b) format6 -> 'a -val error : ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a -val warning : ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a -val info : ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a + (** Exception raised upon fatal errors *) + val check_errors : unit -> bool + (** Check whether errors occured *) + +type warning_type = + | Unnamed (** warnings which cannot be turned off *) + | Unknown_attribute (** usage of unsupported/unknown attributes *) + | Zero_length_array (** gnu extension for zero lenght arrays *) + | Celeven_extension (** C11 fetatures *) + | Gnu_empty_struct (** gnu extension for empty struct *) + | Missing_declarations (** declation which do not declare anything *) + | Constant_conversion (** dangerous constant conversions *) + | Int_conversion (** pointer <-> int conversions *) + | Varargs (** promotable vararg argument *) + | Implicit_function_declaration (** deprecated implicit function declaration *) + | Pointer_type_mismatch (** pointer type mismatch in ?: operator *) + | Compare_distinct_pointer_types (** comparison between different pointer types *) + | Pedantic (** non C99 code *) + | Main_return_type (** wrong return type for main *) + | Invalid_noreturn (** noreturn function containing return *) + | Return_type (** void return in non-void function *) + | Literal_range (** literal ranges *) + | Unknown_pragmas (** unknown/unsupported pragma *) + +val warning : (string * int) -> warning_type -> ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a +(** [warning (f,c) w fmt arg1 ... argN] formats the arguments [arg1] to [argN] as warining according to + the format string [fmt] and outputs the result on [stderr] with additional file [f] and column [c] + and warning key for [w] *) + +val error : (string * int) -> ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a +(** [error (f,c) w fmt arg1 ... argN] formats the arguments [arg1] to [argN] as error according to + the format string [fmt] and outputs the result on [stderr] with additional file [f] and column [c] + and warning key for [w]. *) + +val fatal_error : (string * int) -> ('a, Format.formatter, unit, unit, unit, 'b) format6 -> 'a +(** [fatal_error (f,c) w fmt arg1 ... argN] formats the arguments [arg1] to [argN] as error according to + the format string [fmt] and outputs the result on [stderr] with additional file [f] and column [c] + and warning key for [w]. Additionally raises the excpetion [Abort] after printing the error message *) + +val fatal_error_raw : ('a, out_channel, unit, 'b) format4 -> 'a +(** [fatal_error_raw] is identical to fatal_error, except it uses [Printf] and does not automatically + introduce indentation *) + +val warning_help : string +(** Help string for all warning options *) + +val warning_options : (Commandline.pattern * Commandline.action) list +(** List of all options for diagnostics *) + val raise_on_errors : unit -> unit |