From ada3c2411aab46eb26753c428a0ca56c9adfc428 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 3 Jun 2018 11:48:37 +0200 Subject: Warn for defs and uses of static variables in nonstatic inline functions Nonstatic inline functions can be expanded in several compilation units. The static variables in question may differ between different expansions. This is a manual merge and adaptation of pull request #P95 by @bschommer. --- cparser/Diagnostics.mli | 1 + 1 file changed, 1 insertion(+) (limited to 'cparser/Diagnostics.mli') diff --git a/cparser/Diagnostics.mli b/cparser/Diagnostics.mli index 4f3aebe9..0d49cd0b 100644 --- a/cparser/Diagnostics.mli +++ b/cparser/Diagnostics.mli @@ -51,6 +51,7 @@ type warning_type = | Unused_ais_parameter (** unused builtin ais parameter *) | Ignored_attributes (** attributes declarations after definition *) | Extern_after_definition (** extern declaration after non-extern definition *) + | Static_in_inline (** static variable in non-static inline function *) 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 -- cgit