From 711730fbbc8440aa07542a250123bfc504169b56 Mon Sep 17 00:00:00 2001 From: Andre Maroneze <andre.maroneze@cea.fr> Date: Tue, 14 Dec 2021 17:23:51 +0100 Subject: [PATCH] [Variadic] add several wkeys --- src/plugins/variadic/classify.ml | 8 +-- src/plugins/variadic/format_parser.ml | 2 +- src/plugins/variadic/generic.ml | 2 +- src/plugins/variadic/options.ml | 6 +++ src/plugins/variadic/options.mli | 6 +++ src/plugins/variadic/standard.ml | 22 ++++---- .../redefine_anonymous_parameters.res.oracle | 6 ++- .../tests/erroneous/oracle/exec.res.oracle | 6 +-- .../erroneous/oracle/invalid_libc.res.oracle | 2 +- .../tests/erroneous/oracle/no-libc.res.oracle | 6 ++- .../tests/erroneous/oracle/printf.res.oracle | 4 +- .../oracle/va_arg-wrongtype.res.oracle | 2 +- .../tests/known/oracle/exec.res.oracle | 6 +-- .../tests/known/oracle/fcntl.res.oracle | 4 +- .../tests/known/oracle/open.res.oracle | 4 +- .../tests/known/oracle/open_wrong.res.oracle | 2 +- .../tests/known/oracle/openat.res.oracle | 4 +- .../tests/known/oracle/printf.res.oracle | 2 +- .../known/oracle/printf_redefined.res.oracle | 8 +-- .../oracle/printf_wrong_arity.res.oracle | 4 +- .../oracle/printf_wrong_types.res.oracle | 54 +++++++++---------- .../tests/known/oracle/scanf_wrong.res.oracle | 2 +- 22 files changed, 90 insertions(+), 72 deletions(-) diff --git a/src/plugins/variadic/classify.ml b/src/plugins/variadic/classify.ml index f2fd26fac78..1a183c1826e 100644 --- a/src/plugins/variadic/classify.ml +++ b/src/plugins/variadic/classify.ml @@ -35,7 +35,7 @@ let find_function env s = try Some (Environment.find_function env s) with Not_found -> - Self.warning + Self.warning ~wkey:wkey_libc_framac "Unable to locate function %s which should be in the Frama-C LibC." s; None @@ -56,7 +56,7 @@ let mk_aggregator env fun_name a_pos pname a_type = (* Check that pos is a valid position in the list *) assert (a_pos >= 0); if a_pos >= List.length params then begin - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_libc "The standard function %s should have at least %d parameters." fun_name (a_pos + 1); @@ -69,7 +69,7 @@ let mk_aggregator env fun_name a_pos pname a_type = | TArray (typ,_,_) | TPtr (typ, _) -> typ | _ -> - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_libc "The parameter %d of standard function %s should be \ of array type." (a_pos + 1) @@ -93,7 +93,7 @@ let mk_format_fun vi f_kind f_buffer ~format_pos = and n_actual_args = List.length (Typ.params vi.vtype) in if n_actual_args < n_expected_args then begin - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_libc "The standard function %s was expected to have at least %d fixed \ parameters but only has %d.@ \ No variadic translation will be performed." diff --git a/src/plugins/variadic/format_parser.ml b/src/plugins/variadic/format_parser.ml index eba2d018d3d..1fb3bee4d63 100644 --- a/src/plugins/variadic/format_parser.ml +++ b/src/plugins/variadic/format_parser.ml @@ -26,7 +26,7 @@ open Format_pprint exception Invalid_format -let warn f = Options.Self.warning ~current:true f +let warn f = Options.Self.warning ~current:true ~wkey:Options.wkey_format f (* ************************************************************************ *) (* printf format verification *) diff --git a/src/plugins/variadic/generic.ml b/src/plugins/variadic/generic.ml index 56d847f4a86..7361c6011a5 100644 --- a/src/plugins/variadic/generic.ml +++ b/src/plugins/variadic/generic.ml @@ -109,7 +109,7 @@ let translate_va_builtin caller inst = if Cil.isIntegralType ty then begin let promoted_type = Cil.integralPromotion ty in if promoted_type <> ty then - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_typing "Wrong type argument in va_start: %a is promoted to %a when used \ in the variadic part of the arguments. (You should pass %a to \ va_start)" diff --git a/src/plugins/variadic/options.ml b/src/plugins/variadic/options.ml index 9aef64f8ad3..1a0d8c7c49d 100644 --- a/src/plugins/variadic/options.ml +++ b/src/plugins/variadic/options.ml @@ -42,3 +42,9 @@ module Strict = Self.True distinct integral types which have the same size and \ signedness" end) + +let wkey_libc = Self.register_warn_category "libc" +let wkey_format = Self.register_warn_category "libc:format" +let wkey_libc_framac = Self.register_warn_category "libc:frama-c" +let wkey_prototype = Self.register_warn_category "prototype" +let wkey_typing = Self.register_warn_category "typing" diff --git a/src/plugins/variadic/options.mli b/src/plugins/variadic/options.mli index d5d963658af..10d98f1e668 100644 --- a/src/plugins/variadic/options.mli +++ b/src/plugins/variadic/options.mli @@ -23,3 +23,9 @@ module Self : Plugin.General_services module Enabled : Parameter_sig.Bool module Strict : Parameter_sig.Bool + +val wkey_format: Self.warn_category +val wkey_libc: Self.warn_category +val wkey_libc_framac: Self.warn_category +val wkey_prototype: Self.warn_category +val wkey_typing: Self.warn_category diff --git a/src/plugins/variadic/standard.ml b/src/plugins/variadic/standard.ml index 9e927870b2a..facd3afef6d 100644 --- a/src/plugins/variadic/standard.ml +++ b/src/plugins/variadic/standard.ml @@ -131,12 +131,12 @@ let cast_arg i paramtyp exp = | Strict | Tolerated -> () | (NonPortable | NonStrict) when not (Strict.get ()) -> () | NonPortable -> - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_typing "Possible portability issues with enum type for argument %d \ (use -variadic-no-strict to avoid this warning)." (i + 1) | NonStrict | Never -> - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_typing "Incorrect type for argument %d. \ The argument will be cast from %a to %a." (i + 1) @@ -151,12 +151,12 @@ let match_args ~callee tparams args = let paramcount = List.length tparams and argcount = List.length args in if argcount > paramcount then - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_typing "Too many arguments: expected %d, given %d. \ Superfluous arguments will be removed." paramcount argcount else if argcount < paramcount then ( - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_typing "Not enough arguments: expected %d, given %d." paramcount argcount; raise (Translate_call_exn callee) @@ -255,7 +255,7 @@ let aggregator_call ~fundec ~ghost aggregator scope loc mk_call vf args = let argcount = List.length args and paramcount = List.length tparams in if argcount < paramcount then begin - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_typing "Not enough arguments: expected %d, given %d." paramcount argcount; raise (Translate_call_exn vf.vf_decl); @@ -345,7 +345,7 @@ let overloaded_call ~fundec overload block loc mk_call vf args = let tparams, new_callee = match filter_matching_prototypes overload args with | [] -> (* No matching prototype *) - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_prototype "@[No matching prototype found for this call to %s.@.\ Expected candidates:@.\ @[<v> %a@]@.\ @@ -357,7 +357,7 @@ let overloaded_call ~fundec overload block loc mk_call vf args = | [(tparams,vi)] -> (* Exactly one matching prototype *) tparams, vi | l -> (* Several matching prototypes *) - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_prototype "Ambiguous call to %s. Matching candidates are: \ %a" name @@ -392,7 +392,7 @@ let find_global env name = try Some (Environment.find_global env name) with Not_found -> - Self.warning ~once:true + Self.warning ~once:true ~wkey:wkey_libc_framac "Unable to locate global %s which should be in the Frama-C LibC. \ Correct specifications can't be generated." name; @@ -402,7 +402,7 @@ let find_predicate name = match Logic_env.find_all_logic_functions name with | f :: _q -> f (* TODO: should we warn in case of overloading? *) | [] -> - Self.warning ~once:true + Self.warning ~once:true ~wkey:wkey_libc_framac "Unable to locate ACSL predicate %s which should be in the Frama-C LibC. \ Correct specifications can't be generated." name; @@ -428,7 +428,7 @@ let find_predicate_by_width typ narrow_name wide_name = Cil.theMachine.Cil.wcharType -> find_predicate wide_name | _ -> - Self.warning ~current:true + Self.warning ~current:true ~wkey:wkey_typing "expected single/wide character pointer type, got %a (%a, unrolled %a)" Printer.pp_typ typ Cil_types_debug.pp_typ typ Cil_types_debug.pp_typ (Cil.unrollTypeDeep typ); raise Not_found @@ -705,7 +705,7 @@ let infer_format_from_args vf format_fun args = | ScanfLike -> if not (Cil.isPointerType t) then begin let source = fst arg.eloc in - Self.warning ~source + Self.warning ~source ~wkey:wkey_typing "Expecting pointer as parameter of scanf function. \ Argument %a has type %a" Printer.pp_exp arg Printer.pp_typ t; diff --git a/src/plugins/variadic/tests/declared/oracle/redefine_anonymous_parameters.res.oracle b/src/plugins/variadic/tests/declared/oracle/redefine_anonymous_parameters.res.oracle index a3ae37824e7..5f6d9b83b39 100644 --- a/src/plugins/variadic/tests/declared/oracle/redefine_anonymous_parameters.res.oracle +++ b/src/plugins/variadic/tests/declared/oracle/redefine_anonymous_parameters.res.oracle @@ -1,7 +1,9 @@ [variadic] redefine_anonymous_parameters.i:1: Declaration of variadic function printf. -[variadic] Warning: Unable to locate ACSL predicate valid_read_string which should be in the Frama-C LibC. Correct specifications can't be generated. -[variadic] Warning: Unable to locate global __fc_stdout which should be in the Frama-C LibC. Correct specifications can't be generated. +[variadic:libc:frama-c] Warning: + Unable to locate ACSL predicate valid_read_string which should be in the Frama-C LibC. Correct specifications can't be generated. +[variadic:libc:frama-c] Warning: + Unable to locate global __fc_stdout which should be in the Frama-C LibC. Correct specifications can't be generated. [variadic] redefine_anonymous_parameters.i:4: Translating call to printf to a call to the specialized version printf_va_1. [eva] Analyzing a complete application starting at main diff --git a/src/plugins/variadic/tests/erroneous/oracle/exec.res.oracle b/src/plugins/variadic/tests/erroneous/oracle/exec.res.oracle index 0bf71555038..085bd49daed 100644 --- a/src/plugins/variadic/tests/erroneous/oracle/exec.res.oracle +++ b/src/plugins/variadic/tests/erroneous/oracle/exec.res.oracle @@ -4,16 +4,16 @@ Declaration of variadic function execle. [variadic] FRAMAC_SHARE/libc/unistd.h:810: Declaration of variadic function execlp. -[variadic] exec.c:5: Warning: +[variadic:typing] exec.c:5: Warning: Incorrect type for argument 3. The argument will be cast from int to char *. [variadic] exec.c:5: Translating call to execl to a call to execv. [variadic] exec.c:7: Warning: Failed to find a sentinel (NULL pointer) in the argument list. [variadic] exec.c:7: Fallback translation of call execlp to a call to the specialized version execlp_fallback_1. -[variadic] exec.c:9: Warning: Not enough arguments: expected 5, given 4. +[variadic:typing] exec.c:9: Warning: Not enough arguments: expected 5, given 4. [variadic] exec.c:9: Fallback translation of call execle to a call to the specialized version execle_fallback_1. -[variadic] exec.c:11: Warning: +[variadic:typing] exec.c:11: Warning: Incorrect type for argument 5. The argument will be cast from int to char * const *. [variadic] exec.c:11: Translating call to execle to a call to execve. diff --git a/src/plugins/variadic/tests/erroneous/oracle/invalid_libc.res.oracle b/src/plugins/variadic/tests/erroneous/oracle/invalid_libc.res.oracle index c830fa3b1f6..e0a425d9a52 100644 --- a/src/plugins/variadic/tests/erroneous/oracle/invalid_libc.res.oracle +++ b/src/plugins/variadic/tests/erroneous/oracle/invalid_libc.res.oracle @@ -1,5 +1,5 @@ [variadic] invalid_libc.i:2: Declaration of variadic function fprintf. -[variadic] invalid_libc.i:2: Warning: +[variadic:libc] invalid_libc.i:2: Warning: The standard function fprintf was expected to have at least 2 fixed parameters but only has 1. No variadic translation will be performed. [variadic] invalid_libc.i:6: Generic translation of call to variadic function. diff --git a/src/plugins/variadic/tests/erroneous/oracle/no-libc.res.oracle b/src/plugins/variadic/tests/erroneous/oracle/no-libc.res.oracle index 6f2256ced84..3178a54947e 100644 --- a/src/plugins/variadic/tests/erroneous/oracle/no-libc.res.oracle +++ b/src/plugins/variadic/tests/erroneous/oracle/no-libc.res.oracle @@ -1,5 +1,7 @@ [variadic] no-libc.i:1: Declaration of variadic function printf. -[variadic] Warning: Unable to locate ACSL predicate valid_read_string which should be in the Frama-C LibC. Correct specifications can't be generated. -[variadic] Warning: Unable to locate global __fc_stdout which should be in the Frama-C LibC. Correct specifications can't be generated. +[variadic:libc:frama-c] Warning: + Unable to locate ACSL predicate valid_read_string which should be in the Frama-C LibC. Correct specifications can't be generated. +[variadic:libc:frama-c] Warning: + Unable to locate global __fc_stdout which should be in the Frama-C LibC. Correct specifications can't be generated. [variadic] no-libc.i:5: Translating call to printf to a call to the specialized version printf_va_1. diff --git a/src/plugins/variadic/tests/erroneous/oracle/printf.res.oracle b/src/plugins/variadic/tests/erroneous/oracle/printf.res.oracle index b22f9025dba..38a9205c376 100644 --- a/src/plugins/variadic/tests/erroneous/oracle/printf.res.oracle +++ b/src/plugins/variadic/tests/erroneous/oracle/printf.res.oracle @@ -16,8 +16,8 @@ Declaration of variadic function dprintf. [variadic] FRAMAC_SHARE/libc/stdio.h:590: Declaration of variadic function asprintf. -[variadic] printf.c:8: Warning: Multiple usage of flag '-'. -[variadic] printf.c:8: Warning: +[variadic:libc:format] printf.c:8: Warning: Multiple usage of flag '-'. +[variadic:libc:format] printf.c:8: Warning: Flag ' ' and conversion specififer e are not compatibles. [variadic] printf.c:8: Fallback translation of call printf to a call to the specialized version printf_fallback_1. diff --git a/src/plugins/variadic/tests/erroneous/oracle/va_arg-wrongtype.res.oracle b/src/plugins/variadic/tests/erroneous/oracle/va_arg-wrongtype.res.oracle index ff77e4725d8..b51862515df 100644 --- a/src/plugins/variadic/tests/erroneous/oracle/va_arg-wrongtype.res.oracle +++ b/src/plugins/variadic/tests/erroneous/oracle/va_arg-wrongtype.res.oracle @@ -1,5 +1,5 @@ [variadic] va_arg-wrongtype.c:3: Declaration of variadic function sum. -[variadic] va_arg-wrongtype.c:9: Warning: +[variadic:typing] va_arg-wrongtype.c:9: Warning: Wrong type argument in va_start: short is promoted to int when used in the variadic part of the arguments. (You should pass int to va_start) [variadic] va_arg-wrongtype.c:18: Generic translation of call to variadic function. diff --git a/src/plugins/variadic/tests/known/oracle/exec.res.oracle b/src/plugins/variadic/tests/known/oracle/exec.res.oracle index 279def5dd32..d8d3c2140b9 100644 --- a/src/plugins/variadic/tests/known/oracle/exec.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/exec.res.oracle @@ -5,13 +5,13 @@ [variadic] FRAMAC_SHARE/libc/unistd.h:810: Declaration of variadic function execlp. [variadic] exec.c:9: Translating call to execle to a call to execve. -[variadic] exec.c:11: Warning: +[variadic:typing] exec.c:11: Warning: Too many arguments: expected 5, given 6. Superfluous arguments will be removed. [variadic] exec.c:11: Translating call to execl to a call to execv. -[variadic] exec.c:12: Warning: +[variadic:typing] exec.c:12: Warning: Too many arguments: expected 4, given 5. Superfluous arguments will be removed. [variadic] exec.c:12: Translating call to execlp to a call to execvp. -[variadic] exec.c:13: Warning: +[variadic:typing] exec.c:13: Warning: Too many arguments: expected 4, given 6. Superfluous arguments will be removed. [variadic] exec.c:13: Translating call to execle to a call to execve. [variadic] exec.c:15: Warning: diff --git a/src/plugins/variadic/tests/known/oracle/fcntl.res.oracle b/src/plugins/variadic/tests/known/oracle/fcntl.res.oracle index 79b0b40397e..ff5a912894d 100644 --- a/src/plugins/variadic/tests/known/oracle/fcntl.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/fcntl.res.oracle @@ -9,7 +9,7 @@ Translating call to the specialized version fcntl(int, int, int). [variadic] fcntl.c:10: Translating call to the specialized version fcntl(int, int, struct flock *). -[variadic] fcntl.c:16: Warning: +[variadic:prototype] fcntl.c:16: Warning: No matching prototype found for this call to fcntl. Expected candidates: fcntl(int, int) @@ -23,7 +23,7 @@ Translating call to the specialized version fcntl(int, int). [variadic] fcntl.c:24: Translating call to the specialized version fcntl(int, int, struct flock *). -[variadic] fcntl.c:28: Warning: +[variadic:prototype] fcntl.c:28: Warning: No matching prototype found for this call to fcntl. Expected candidates: fcntl(int, int) diff --git a/src/plugins/variadic/tests/known/oracle/open.res.oracle b/src/plugins/variadic/tests/known/oracle/open.res.oracle index ff7c52d67cc..9b5c71ca58f 100644 --- a/src/plugins/variadic/tests/known/oracle/open.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/open.res.oracle @@ -5,11 +5,11 @@ Declaration of variadic function openat. [variadic] open.c:7: Translating call to the specialized version open(char const *, int, mode_t). -[variadic] open.c:7: Warning: +[variadic:typing] open.c:7: Warning: Incorrect type for argument 3. The argument will be cast from int to mode_t. [variadic] open.c:8: Translating call to the specialized version open(char const *, int). -[variadic] open.c:9: Warning: +[variadic:prototype] open.c:9: Warning: No matching prototype found for this call to open. Expected candidates: open(char const *, int) diff --git a/src/plugins/variadic/tests/known/oracle/open_wrong.res.oracle b/src/plugins/variadic/tests/known/oracle/open_wrong.res.oracle index 45d5466519d..1f4b8a7cd11 100644 --- a/src/plugins/variadic/tests/known/oracle/open_wrong.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/open_wrong.res.oracle @@ -3,7 +3,7 @@ [variadic] FRAMAC_SHARE/libc/fcntl.h:124: Declaration of variadic function open. [variadic] FRAMAC_SHARE/libc/fcntl.h:131: Declaration of variadic function openat. -[variadic] open_wrong.c:13: Warning: +[variadic:prototype] open_wrong.c:13: Warning: No matching prototype found for this call to open. Expected candidates: open(char const *, int) diff --git a/src/plugins/variadic/tests/known/oracle/openat.res.oracle b/src/plugins/variadic/tests/known/oracle/openat.res.oracle index 9df27b194b9..8773e0e6c29 100644 --- a/src/plugins/variadic/tests/known/oracle/openat.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/openat.res.oracle @@ -7,9 +7,9 @@ Translating call to the specialized version openat(int, char const *, int, mode_t). [variadic] openat.c:9: Translating call to the specialized version openat(int, char const *, int, mode_t). -[variadic] openat.c:9: Warning: +[variadic:typing] openat.c:9: Warning: Incorrect type for argument 4. The argument will be cast from int to mode_t. -[variadic] openat.c:10: Warning: +[variadic:prototype] openat.c:10: Warning: No matching prototype found for this call to openat. Expected candidates: openat(int, char const *, int) diff --git a/src/plugins/variadic/tests/known/oracle/printf.res.oracle b/src/plugins/variadic/tests/known/oracle/printf.res.oracle index a129b3b58e8..995179fa658 100644 --- a/src/plugins/variadic/tests/known/oracle/printf.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/printf.res.oracle @@ -80,7 +80,7 @@ Translating call to printf to a call to the specialized version printf_va_25. [variadic] printf.c:69: Translating call to printf to a call to the specialized version printf_va_26. -[variadic] printf.c:71: Warning: +[variadic:libc:format] printf.c:71: Warning: Flag ' ' and conversion specififer x are not compatibles. [variadic] printf.c:71: Fallback translation of call printf to a call to the specialized version printf_fallback_1. diff --git a/src/plugins/variadic/tests/known/oracle/printf_redefined.res.oracle b/src/plugins/variadic/tests/known/oracle/printf_redefined.res.oracle index 1ff78606241..abc776ec38f 100644 --- a/src/plugins/variadic/tests/known/oracle/printf_redefined.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/printf_redefined.res.oracle @@ -1,9 +1,11 @@ [variadic] printf_redefined.i:3: Declaration of variadic function printf. -[variadic] Warning: Unable to locate ACSL predicate valid_read_string which should be in the Frama-C LibC. Correct specifications can't be generated. -[variadic] Warning: Unable to locate global __fc_stdout which should be in the Frama-C LibC. Correct specifications can't be generated. +[variadic:libc:frama-c] Warning: + Unable to locate ACSL predicate valid_read_string which should be in the Frama-C LibC. Correct specifications can't be generated. +[variadic:libc:frama-c] Warning: + Unable to locate global __fc_stdout which should be in the Frama-C LibC. Correct specifications can't be generated. [variadic] printf_redefined.i:7: Translating call to printf to a call to the specialized version printf_va_1. -[variadic] printf_redefined.i:7: Warning: +[variadic:typing] printf_redefined.i:7: Warning: Incorrect type for argument 2. The argument will be cast from long to size_t. [eva] Analyzing a complete application starting at main [eva] Computing initial state diff --git a/src/plugins/variadic/tests/known/oracle/printf_wrong_arity.res.oracle b/src/plugins/variadic/tests/known/oracle/printf_wrong_arity.res.oracle index 813cf4c15be..35de0b879c1 100644 --- a/src/plugins/variadic/tests/known/oracle/printf_wrong_arity.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/printf_wrong_arity.res.oracle @@ -18,11 +18,11 @@ Declaration of variadic function asprintf. [variadic] printf_wrong_arity.c:8: Translating call to printf to a call to the specialized version printf_va_1. -[variadic] printf_wrong_arity.c:8: Warning: +[variadic:typing] printf_wrong_arity.c:8: Warning: Too many arguments: expected 2, given 3. Superfluous arguments will be removed. [variadic] printf_wrong_arity.c:9: Translating call to printf to a call to the specialized version printf_va_2. -[variadic] printf_wrong_arity.c:9: Warning: +[variadic:typing] printf_wrong_arity.c:9: Warning: Not enough arguments: expected 3, given 2. [variadic] printf_wrong_arity.c:9: Fallback translation of call printf to a call to the specialized version printf_va_2_fallback_1. diff --git a/src/plugins/variadic/tests/known/oracle/printf_wrong_types.res.oracle b/src/plugins/variadic/tests/known/oracle/printf_wrong_types.res.oracle index b1028e13ef6..14b7c5c54a5 100644 --- a/src/plugins/variadic/tests/known/oracle/printf_wrong_types.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/printf_wrong_types.res.oracle @@ -20,61 +20,61 @@ Translating call to printf to a call to the specialized version printf_va_1. [variadic] printf_wrong_types.c:19: Translating call to printf to a call to the specialized version printf_va_2. -[variadic] printf_wrong_types.c:19: Warning: +[variadic:typing] printf_wrong_types.c:19: Warning: Incorrect type for argument 2. The argument will be cast from unsigned int to int. [variadic] printf_wrong_types.c:20: Translating call to printf to a call to the specialized version printf_va_3. -[variadic] printf_wrong_types.c:20: Warning: +[variadic:typing] printf_wrong_types.c:20: Warning: Incorrect type for argument 2. The argument will be cast from int to unsigned int. [variadic] printf_wrong_types.c:21: Translating call to printf to a call to the specialized version printf_va_4. -[variadic] printf_wrong_types.c:21: Warning: +[variadic:typing] printf_wrong_types.c:21: Warning: Incorrect type for argument 2. The argument will be cast from int to long. [variadic] printf_wrong_types.c:22: Translating call to printf to a call to the specialized version printf_va_5. -[variadic] printf_wrong_types.c:22: Warning: +[variadic:typing] printf_wrong_types.c:22: Warning: Incorrect type for argument 2. The argument will be cast from long to int. [variadic] printf_wrong_types.c:23: Translating call to printf to a call to the specialized version printf_va_6. -[variadic] printf_wrong_types.c:23: Warning: +[variadic:typing] printf_wrong_types.c:23: Warning: Incorrect type for argument 2. The argument will be cast from unsigned int to unsigned long. [variadic] printf_wrong_types.c:24: Translating call to printf to a call to the specialized version printf_va_7. -[variadic] printf_wrong_types.c:24: Warning: +[variadic:typing] printf_wrong_types.c:24: Warning: Incorrect type for argument 2. The argument will be cast from unsigned long to unsigned int. [variadic] printf_wrong_types.c:25: Translating call to printf to a call to the specialized version printf_va_8. -[variadic] printf_wrong_types.c:25: Warning: +[variadic:typing] printf_wrong_types.c:25: Warning: Incorrect type for argument 2. The argument will be cast from unsigned int to void *. [variadic] printf_wrong_types.c:26: Translating call to printf to a call to the specialized version printf_va_9. [variadic] printf_wrong_types.c:27: Translating call to printf to a call to the specialized version printf_va_10. -[variadic] printf_wrong_types.c:27: Warning: +[variadic:typing] printf_wrong_types.c:27: Warning: Incorrect type for argument 2. The argument will be cast from long double to double. [variadic] printf_wrong_types.c:28: Translating call to printf to a call to the specialized version printf_va_11. -[variadic] printf_wrong_types.c:28: Warning: +[variadic:typing] printf_wrong_types.c:28: Warning: Incorrect type for argument 2. The argument will be cast from long double to double. [variadic] printf_wrong_types.c:29: Translating call to printf to a call to the specialized version printf_va_12. -[variadic] printf_wrong_types.c:29: Warning: +[variadic:typing] printf_wrong_types.c:29: Warning: Incorrect type for argument 2. The argument will be cast from double to long double. [variadic] printf_wrong_types.c:30: Translating call to printf to a call to the specialized version printf_va_13. -[variadic] printf_wrong_types.c:30: Warning: +[variadic:typing] printf_wrong_types.c:30: Warning: Incorrect type for argument 2. The argument will be cast from int to char *. [variadic] printf_wrong_types.c:31: Translating call to printf to a call to the specialized version printf_va_14. -[variadic] printf_wrong_types.c:31: Warning: +[variadic:typing] printf_wrong_types.c:31: Warning: Incorrect type for argument 2. The argument will be cast from char * to int. [variadic] printf_wrong_types.c:35: Translating call to printf to a call to the specialized version printf_va_15. -[variadic] printf_wrong_types.c:35: Warning: +[variadic:typing] printf_wrong_types.c:35: Warning: Possible portability issues with enum type for argument 2 (use -variadic-no-strict to avoid this warning). [variadic] printf_wrong_types.c:36: Translating call to printf to a call to the specialized version printf_va_16. -[variadic] printf_wrong_types.c:36: Warning: +[variadic:typing] printf_wrong_types.c:36: Warning: Incorrect type for argument 2. The argument will be cast from RC (unsigned int) to int. [eva] Analyzing a complete application starting at main [eva] Computing initial state @@ -434,59 +434,59 @@ int main(void) Translating call to printf to a call to the specialized version printf_va_1. [variadic] printf_wrong_types.c:19: Translating call to printf to a call to the specialized version printf_va_2. -[variadic] printf_wrong_types.c:19: Warning: +[variadic:typing] printf_wrong_types.c:19: Warning: Incorrect type for argument 2. The argument will be cast from unsigned int to int. [variadic] printf_wrong_types.c:20: Translating call to printf to a call to the specialized version printf_va_3. -[variadic] printf_wrong_types.c:20: Warning: +[variadic:typing] printf_wrong_types.c:20: Warning: Incorrect type for argument 2. The argument will be cast from int to unsigned int. [variadic] printf_wrong_types.c:21: Translating call to printf to a call to the specialized version printf_va_4. -[variadic] printf_wrong_types.c:21: Warning: +[variadic:typing] printf_wrong_types.c:21: Warning: Incorrect type for argument 2. The argument will be cast from int to long. [variadic] printf_wrong_types.c:22: Translating call to printf to a call to the specialized version printf_va_5. -[variadic] printf_wrong_types.c:22: Warning: +[variadic:typing] printf_wrong_types.c:22: Warning: Incorrect type for argument 2. The argument will be cast from long to int. [variadic] printf_wrong_types.c:23: Translating call to printf to a call to the specialized version printf_va_6. -[variadic] printf_wrong_types.c:23: Warning: +[variadic:typing] printf_wrong_types.c:23: Warning: Incorrect type for argument 2. The argument will be cast from unsigned int to unsigned long. [variadic] printf_wrong_types.c:24: Translating call to printf to a call to the specialized version printf_va_7. -[variadic] printf_wrong_types.c:24: Warning: +[variadic:typing] printf_wrong_types.c:24: Warning: Incorrect type for argument 2. The argument will be cast from unsigned long to unsigned int. [variadic] printf_wrong_types.c:25: Translating call to printf to a call to the specialized version printf_va_8. -[variadic] printf_wrong_types.c:25: Warning: +[variadic:typing] printf_wrong_types.c:25: Warning: Incorrect type for argument 2. The argument will be cast from unsigned int to void *. [variadic] printf_wrong_types.c:26: Translating call to printf to a call to the specialized version printf_va_9. [variadic] printf_wrong_types.c:27: Translating call to printf to a call to the specialized version printf_va_10. -[variadic] printf_wrong_types.c:27: Warning: +[variadic:typing] printf_wrong_types.c:27: Warning: Incorrect type for argument 2. The argument will be cast from long double to double. [variadic] printf_wrong_types.c:28: Translating call to printf to a call to the specialized version printf_va_11. -[variadic] printf_wrong_types.c:28: Warning: +[variadic:typing] printf_wrong_types.c:28: Warning: Incorrect type for argument 2. The argument will be cast from long double to double. [variadic] printf_wrong_types.c:29: Translating call to printf to a call to the specialized version printf_va_12. -[variadic] printf_wrong_types.c:29: Warning: +[variadic:typing] printf_wrong_types.c:29: Warning: Incorrect type for argument 2. The argument will be cast from double to long double. [variadic] printf_wrong_types.c:30: Translating call to printf to a call to the specialized version printf_va_13. -[variadic] printf_wrong_types.c:30: Warning: +[variadic:typing] printf_wrong_types.c:30: Warning: Incorrect type for argument 2. The argument will be cast from int to char *. [variadic] printf_wrong_types.c:31: Translating call to printf to a call to the specialized version printf_va_14. -[variadic] printf_wrong_types.c:31: Warning: +[variadic:typing] printf_wrong_types.c:31: Warning: Incorrect type for argument 2. The argument will be cast from char * to int. [variadic] printf_wrong_types.c:35: Translating call to printf to a call to the specialized version printf_va_15. [variadic] printf_wrong_types.c:36: Translating call to printf to a call to the specialized version printf_va_16. -[variadic] printf_wrong_types.c:36: Warning: +[variadic:typing] printf_wrong_types.c:36: Warning: Incorrect type for argument 2. The argument will be cast from RC (unsigned int) to int. [eva] Analyzing a complete application starting at main [eva] Computing initial state diff --git a/src/plugins/variadic/tests/known/oracle/scanf_wrong.res.oracle b/src/plugins/variadic/tests/known/oracle/scanf_wrong.res.oracle index eb258278992..56a0358892b 100644 --- a/src/plugins/variadic/tests/known/oracle/scanf_wrong.res.oracle +++ b/src/plugins/variadic/tests/known/oracle/scanf_wrong.res.oracle @@ -18,7 +18,7 @@ Declaration of variadic function asprintf. [variadic] scanf_wrong.c:8: Translating call to scanf to a call to the specialized version scanf_va_1. -[variadic] scanf_wrong.c:8: Warning: +[variadic:typing] scanf_wrong.c:8: Warning: Incorrect type for argument 2. The argument will be cast from double to char *. [eva] Analyzing a complete application starting at main [eva] Computing initial state -- GitLab