From fe21a76f324048e12b4dc69690082b19827ec72d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 22 Feb 2012 17:35:15 +0300 Subject: [PATCH] tree wide: don't print offset into function This is another formatting change for Artem. It used to be, that I used the offset that if the offset into a function changed between two smatch runs I counted that as a new warning. It obviously isn't accurate, but sometimes it's nice to revisit warnings if people are working on the code around them. But actually I don't care that much so I'll change it to match what Artem wants. Signed-off-by: Dan Carpenter --- check_stack.c | 5 +-- smatch.h | 3 +- smatch_flow.c | 1 - smatch_scripts/follow_params.pl | 2 +- smatch_scripts/trace_params.pl | 2 +- smatch_scripts/unlocked_paths.pl | 2 +- validation/sm_WtoA.c | 2 +- validation/sm_array_overflow.c | 16 +++++----- validation/sm_array_overflow2.c | 2 +- validation/sm_array_overflow3.c | 2 +- validation/sm_array_overflow4.c | 10 +++--- validation/sm_casts.c | 10 +++--- validation/sm_casts2.c | 4 +-- validation/sm_check_kunmap.c | 4 +-- validation/sm_compare.c | 14 ++++---- validation/sm_compare2.c | 12 +++---- validation/sm_compound_condition.c | 2 +- validation/sm_compound_conditions2.c | 32 +++++++++---------- validation/sm_compound_conditions3.c | 8 ++--- validation/sm_deref_check_deref.c | 4 +-- validation/sm_dev_hold.c | 2 +- validation/sm_double_free1.c | 2 +- validation/sm_double_free2.c | 2 +- validation/sm_efault.c | 2 +- validation/sm_equiv1.c | 16 +++++----- validation/sm_equiv2.c | 8 ++--- validation/sm_equiv3.c | 4 +-- validation/sm_equiv4.c | 2 +- validation/sm_err_ptr.c | 2 +- validation/sm_get_user1.c | 6 ++-- validation/sm_implied.c | 2 +- validation/sm_implied10.c | 8 ++--- validation/sm_implied2.c | 2 +- validation/sm_implied4.c | 2 +- validation/sm_implied5.c | 2 +- validation/sm_implied6.c | 2 +- validation/sm_implied7.c | 6 ++-- validation/sm_implied8.c | 14 ++++---- validation/sm_implied9.c | 10 +++--- validation/sm_locking.c | 4 +-- validation/sm_locking2.c | 4 +-- validation/sm_locking3.c | 4 +-- validation/sm_locking4.c | 2 +- validation/sm_locking6.c | 4 +-- validation/sm_loops1.c | 16 +++++----- validation/sm_loops2.c | 18 +++++------ validation/sm_loops3.c | 2 +- validation/sm_loops4.c | 2 +- validation/sm_macros.c | 12 +++---- validation/sm_math1.c | 10 +++--- validation/sm_memleak2.c | 2 +- validation/sm_memory.c | 2 +- validation/sm_netdevice.c | 4 +-- validation/sm_null_deref.c | 10 +++--- validation/sm_null_deref2.c | 2 +- validation/sm_overflow.c | 2 +- validation/sm_overflow3.c | 6 ++-- validation/sm_overflow4.c | 2 +- validation/sm_overflow5.c | 2 +- validation/sm_overflow6.c | 6 ++-- validation/sm_precedence.c | 12 +++---- validation/sm_propagate.c | 2 +- validation/sm_range2.c | 18 +++++------ validation/sm_range3.c | 40 +++++++++++------------ validation/sm_range4.c | 12 +++---- validation/sm_redundant_check.c | 4 +-- validation/sm_rosenberg.c | 8 ++--- validation/sm_select.c | 10 +++--- validation/sm_select2.c | 2 +- validation/sm_select3.c | 62 ++++++++++++++++++------------------ validation/sm_select4.c | 6 ++-- validation/sm_select_assign.c | 8 ++--- validation/sm_skb.c | 10 +++--- validation/sm_strlen.c | 2 +- validation/sm_strlen2.c | 6 ++-- validation/sm_switch.c | 4 +-- validation/sm_switch2.c | 4 +-- validation/sm_wine_filehandles.c | 4 +-- validation/sm_wine_locking.c | 6 ++-- 79 files changed, 281 insertions(+), 286 deletions(-) diff --git a/check_stack.c b/check_stack.c index 2009b64b..23c00a78 100644 --- a/check_stack.c +++ b/check_stack.c @@ -20,7 +20,6 @@ static int my_id; static int total_size; static int max_size; static int max_lineno; -static int max_func_pos; static int complained; static void scope_end(int size) @@ -41,7 +40,6 @@ static void match_declarations(struct symbol *sym) if (total_size > max_size) { max_size = total_size; max_lineno = get_lineno(); - max_func_pos = get_func_pos(); } if (base->bit_size >= 500 * 8) { complained = 1; @@ -53,14 +51,13 @@ static void match_declarations(struct symbol *sym) static void match_end_func(struct symbol *sym) { if ((max_size >= 500 * 8) && !complained) { - sm_printf("%s:%d %s(%d) ", get_filename(), max_lineno, get_function(), max_func_pos); + sm_printf("%s:%d %s() ", get_filename(), max_lineno, get_function()); sm_printf("warn: function puts %d bytes on stack\n", max_size / 8); } total_size = 0; complained = 0; max_size = 0; max_lineno = 0; - max_func_pos = 0; } void check_stack(int id) diff --git a/smatch.h b/smatch.h index ec4b771c..20454fb8 100644 --- a/smatch.h +++ b/smatch.h @@ -125,7 +125,6 @@ void __use_default_modification_hook(int owner, const char *variable); const char *get_filename(void); char *get_function(void); int get_lineno(void); -int get_func_pos(void); extern int final_pass; extern struct symbol *cur_func_sym; extern int option_debug; @@ -135,7 +134,7 @@ extern FILE *sm_outfd; static inline void sm_prefix(void) { - sm_printf("%s:%d %s(%d) ", get_filename(), get_lineno(), get_function(), get_func_pos()); + sm_printf("%s:%d %s() ", get_filename(), get_lineno(), get_function()); } static inline void print_implied_debug_msg(); diff --git a/smatch_flow.c b/smatch_flow.c index 9dcf3077..761f5da3 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -35,7 +35,6 @@ int __in_pre_condition = 0; int __bail_on_rest_of_function = 0; char *get_function(void) { return cur_func; } int get_lineno(void) { return __smatch_lineno; } -int get_func_pos(void) { return __smatch_lineno - line_func_start; } int inside_loop(void) { return !!loop_count; } int in_expression_statement(void) { return !!__expr_stmt_count; } diff --git a/smatch_scripts/follow_params.pl b/smatch_scripts/follow_params.pl index 3aaad841..b2b8e773 100755 --- a/smatch_scripts/follow_params.pl +++ b/smatch_scripts/follow_params.pl @@ -65,7 +65,7 @@ sub load_all($) open(FILE, "<$file"); while () { - if (/.*?:\d+ (.*?)\(\d+\) info: param_mapper (\d+) => (.*?) (\d+)/) { + if (/.*?:\d+ (.*?)\(\) info: param_mapper (\d+) => (.*?) (\d+)/) { add_link("$1%$2", "$3%$4"); } } diff --git a/smatch_scripts/trace_params.pl b/smatch_scripts/trace_params.pl index 18c9f3cc..4a720a11 100755 --- a/smatch_scripts/trace_params.pl +++ b/smatch_scripts/trace_params.pl @@ -76,7 +76,7 @@ sub load_all($) open(FILE, "<$file"); while () { - if (/.*?:\d+ (.*?)\(\d+\) info: param_mapper (\d+) => (.*?) (\d+)/) { + if (/.*?:\d+ (.*?)\(\) info: param_mapper (\d+) => (.*?) (\d+)/) { add_link("$1%$2", "$3%$4"); } } diff --git a/smatch_scripts/unlocked_paths.pl b/smatch_scripts/unlocked_paths.pl index b96f9617..f235b87e 100755 --- a/smatch_scripts/unlocked_paths.pl +++ b/smatch_scripts/unlocked_paths.pl @@ -37,7 +37,7 @@ sub load_all($$) open(FILE, "<$file"); while () { - if (/.*?:\d+ (.*?)\(\d+\) info: func_call \((.*)\) (.*)/) { + if (/.*?:\d+ (.*?)\(\) info: func_call \((.*)\) (.*)/) { my $caller = quotemeta $1; my $locks = quotemeta $2; my $callee = quotemeta $3; diff --git a/validation/sm_WtoA.c b/validation/sm_WtoA.c index 7654e864..11b98b92 100644 --- a/validation/sm_WtoA.c +++ b/validation/sm_WtoA.c @@ -24,6 +24,6 @@ void xxxA (void) * check-command: smatch -p=wine sm_WtoA.c * * check-output-start -sm_WtoA.c:6 xxxW(2) warn: WtoA call wwwA() +sm_WtoA.c:6 xxxW() warn: WtoA call wwwA() * check-output-end */ diff --git a/validation/sm_array_overflow.c b/validation/sm_array_overflow.c index 9501994c..2699e511 100644 --- a/validation/sm_array_overflow.c +++ b/validation/sm_array_overflow.c @@ -37,13 +37,13 @@ static int options_write(void) * check-command: smatch sm_array_overflow.c * * check-output-start -sm_array_overflow.c:25 options_write(18) error: buffer overflow 'a' 4 <= 4 -sm_array_overflow.c:26 options_write(19) error: buffer overflow 'b' 4 <= 4 -sm_array_overflow.c:27 options_write(20) error: buffer overflow 'c' 4 <= 4 -sm_array_overflow.c:28 options_write(21) error: buffer overflow 'd' 4 <= 4 -sm_array_overflow.c:29 options_write(22) error: buffer overflow 'str' 4 <= 4 -sm_array_overflow.c:30 options_write(23) error: buffer overflow 'str2' 4 <= 4 -sm_array_overflow.c:31 options_write(24) error: buffer overflow 'str3' 4 <= 4 -sm_array_overflow.c:32 options_write(25) error: buffer overflow 'str4' 4 <= 4 +sm_array_overflow.c:25 options_write() error: buffer overflow 'a' 4 <= 4 +sm_array_overflow.c:26 options_write() error: buffer overflow 'b' 4 <= 4 +sm_array_overflow.c:27 options_write() error: buffer overflow 'c' 4 <= 4 +sm_array_overflow.c:28 options_write() error: buffer overflow 'd' 4 <= 4 +sm_array_overflow.c:29 options_write() error: buffer overflow 'str' 4 <= 4 +sm_array_overflow.c:30 options_write() error: buffer overflow 'str2' 4 <= 4 +sm_array_overflow.c:31 options_write() error: buffer overflow 'str3' 4 <= 4 +sm_array_overflow.c:32 options_write() error: buffer overflow 'str4' 4 <= 4 * check-output-end */ diff --git a/validation/sm_array_overflow2.c b/validation/sm_array_overflow2.c index fac1b050..6cfcd709 100644 --- a/validation/sm_array_overflow2.c +++ b/validation/sm_array_overflow2.c @@ -23,6 +23,6 @@ int main(void) * check-command: smatch sm_array_overflow2.c * * check-output-start -sm_array_overflow2.c:18 main(7) error: buffer overflow 'b' 4 <= 4 +sm_array_overflow2.c:18 main() error: buffer overflow 'b' 4 <= 4 * check-output-end */ diff --git a/validation/sm_array_overflow3.c b/validation/sm_array_overflow3.c index c12ee736..3460000a 100644 --- a/validation/sm_array_overflow3.c +++ b/validation/sm_array_overflow3.c @@ -18,6 +18,6 @@ int main(void) * check-command: smatch sm_array_overflow3.c * * check-output-start -sm_array_overflow3.c:13 main(6) warn: buffer overflow 'a' 4 <= 4 +sm_array_overflow3.c:13 main() warn: buffer overflow 'a' 4 <= 4 * check-output-end */ diff --git a/validation/sm_array_overflow4.c b/validation/sm_array_overflow4.c index f77c9824..36966d4f 100644 --- a/validation/sm_array_overflow4.c +++ b/validation/sm_array_overflow4.c @@ -33,10 +33,10 @@ int main(char *arg0) * check-command: smatch --spammy sm_array_overflow4.c * * check-output-start -sm_array_overflow4.c:22 main(14) error: buffer overflow 's' 8 <= 8 -sm_array_overflow4.c:23 main(15) error: buffer overflow 's2' 8 <= 8 -sm_array_overflow4.c:25 main(17) error: buffer overflow 'a' 8 <= 8 -sm_array_overflow4.c:26 main(18) error: strcpy() '"1234"' too large for 'buf' (5 vs 4) -sm_array_overflow4.c:27 main(19) warn: strcpy() 'arg0' of unknown size might be too large for 'buf2' +sm_array_overflow4.c:22 main() error: buffer overflow 's' 8 <= 8 +sm_array_overflow4.c:23 main() error: buffer overflow 's2' 8 <= 8 +sm_array_overflow4.c:25 main() error: buffer overflow 'a' 8 <= 8 +sm_array_overflow4.c:26 main() error: strcpy() '"1234"' too large for 'buf' (5 vs 4) +sm_array_overflow4.c:27 main() warn: strcpy() 'arg0' of unknown size might be too large for 'buf2' * check-output-end */ diff --git a/validation/sm_casts.c b/validation/sm_casts.c index 7f2d3f96..86796a40 100644 --- a/validation/sm_casts.c +++ b/validation/sm_casts.c @@ -26,10 +26,10 @@ static int options_write(void) * check-command: smatch sm_casts.c * * check-output-start -sm_casts.c:13 options_write(10) warn: -400 is less than -128 (min 'c' can be) so this is always true. -sm_casts.c:15 options_write(12) warn: -400 is less than -128 (min 'c' can be) so this is always false. -sm_casts.c:17 options_write(14) warn: 400 is more than 127 (max 'c' can be) so this is always true. -sm_casts.c:19 options_write(16) warn: -400 is less than -128 (min 'c' can be) so this is always false. -sm_casts.c:21 options_write(18) warn: assigning -12 to unsigned variable 'b' +sm_casts.c:13 options_write() warn: -400 is less than -128 (min 'c' can be) so this is always true. +sm_casts.c:15 options_write() warn: -400 is less than -128 (min 'c' can be) so this is always false. +sm_casts.c:17 options_write() warn: 400 is more than 127 (max 'c' can be) so this is always true. +sm_casts.c:19 options_write() warn: -400 is less than -128 (min 'c' can be) so this is always false. +sm_casts.c:21 options_write() warn: assigning -12 to unsigned variable 'b' * check-output-end */ diff --git a/validation/sm_casts2.c b/validation/sm_casts2.c index beb64216..3672ed3a 100644 --- a/validation/sm_casts2.c +++ b/validation/sm_casts2.c @@ -28,7 +28,7 @@ int main(void) * check-command: smatch sm_casts2.c * * check-output-start -sm_casts2.c:12 main(3) error: *a is never equal to 4294967295 (wrong type 0 - 255). -sm_casts2.c:22 main(13) error: *****d is never equal to 4294967295 (wrong type -128 - 127). +sm_casts2.c:12 main() error: *a is never equal to 4294967295 (wrong type 0 - 255). +sm_casts2.c:22 main() error: *****d is never equal to 4294967295 (wrong type -128 - 127). * check-output-end */ diff --git a/validation/sm_check_kunmap.c b/validation/sm_check_kunmap.c index eeeaca76..4b206a8c 100644 --- a/validation/sm_check_kunmap.c +++ b/validation/sm_check_kunmap.c @@ -24,7 +24,7 @@ void func(void) * check-command: smatch -p=kernel sm_check_kunmap.c * * check-output-start -sm_check_kunmap.c:17 func(9) warn: passing the wrong stuff kunmap() -sm_check_kunmap.c:20 func(12) warn: passing the wrong stuff to kmap_atomic() +sm_check_kunmap.c:17 func() warn: passing the wrong stuff kunmap() +sm_check_kunmap.c:20 func() warn: passing the wrong stuff to kmap_atomic() * check-output-end */ diff --git a/validation/sm_compare.c b/validation/sm_compare.c index 6ce34084..af674de2 100644 --- a/validation/sm_compare.c +++ b/validation/sm_compare.c @@ -30,12 +30,12 @@ static int frob(void) * check-command: smatch -I.. sm_compare.c * * check-output-start -sm_compare.c:15 frob(10) a = empty -sm_compare.c:17 frob(12) b = min-5 -sm_compare.c:19 frob(14) c = empty -sm_compare.c:21 frob(16) c = empty -sm_compare.c:23 frob(18) a = min-5 -sm_compare.c:24 frob(19) b = min-5 -sm_compare.c:25 frob(20) c = 5 +sm_compare.c:15 frob() a = empty +sm_compare.c:17 frob() b = min-5 +sm_compare.c:19 frob() c = empty +sm_compare.c:21 frob() c = empty +sm_compare.c:23 frob() a = min-5 +sm_compare.c:24 frob() b = min-5 +sm_compare.c:25 frob() c = 5 * check-output-end */ diff --git a/validation/sm_compare2.c b/validation/sm_compare2.c index 7b4edab2..e7ff80a1 100644 --- a/validation/sm_compare2.c +++ b/validation/sm_compare2.c @@ -31,11 +31,11 @@ int main(void) * check-command: smatch -I.. sm_compare2.c * * check-output-start -sm_compare2.c:11 main(6) a = 4-10 -sm_compare2.c:17 main(12) b = 3-15 -sm_compare2.c:20 main(15) a = 4-10 -sm_compare2.c:21 main(16) b = 5-15 -sm_compare2.c:23 main(18) a = 4-10 -sm_compare2.c:24 main(19) b = 3-10 +sm_compare2.c:11 main() a = 4-10 +sm_compare2.c:17 main() b = 3-15 +sm_compare2.c:20 main() a = 4-10 +sm_compare2.c:21 main() b = 5-15 +sm_compare2.c:23 main() a = 4-10 +sm_compare2.c:24 main() b = 3-10 * check-output-end */ diff --git a/validation/sm_compound_condition.c b/validation/sm_compound_condition.c index 95463da4..2f9e0c41 100644 --- a/validation/sm_compound_condition.c +++ b/validation/sm_compound_condition.c @@ -22,6 +22,6 @@ void func (void) * check-command: smatch sm_compound_condition.c * * check-output-start -sm_compound_condition.c:18 func(10) error: we previously assumed 'b' could be null (see line 14) +sm_compound_condition.c:18 func() error: we previously assumed 'b' could be null (see line 14) * check-output-end */ diff --git a/validation/sm_compound_conditions2.c b/validation/sm_compound_conditions2.c index 3d651e83..ddcd6473 100644 --- a/validation/sm_compound_conditions2.c +++ b/validation/sm_compound_conditions2.c @@ -53,21 +53,21 @@ void func (void) * check-command: smatch -I.. sm_compound_conditions2.c * * check-output-start -sm_compound_conditions2.c:15 func(9) aaa = 2 -sm_compound_conditions2.c:17 func(11) aaa = 2 -sm_compound_conditions2.c:19 func(13) aaa = 2 -sm_compound_conditions2.c:22 func(16) aaa = 0-1 -sm_compound_conditions2.c:24 func(18) aaa = 1 -sm_compound_conditions2.c:26 func(20) aaa = 0 -sm_compound_conditions2.c:29 func(23) aaa = 1-2 -sm_compound_conditions2.c:31 func(25) aaa = 2 -sm_compound_conditions2.c:33 func(27) aaa = 1 -sm_compound_conditions2.c:36 func(30) aaa = 0,2 -sm_compound_conditions2.c:38 func(32) aaa = 2 -sm_compound_conditions2.c:40 func(34) aaa = 0 -sm_compound_conditions2.c:43 func(37) aaa = 2 -sm_compound_conditions2.c:45 func(39) aaa = 1-2 -sm_compound_conditions2.c:47 func(41) aaa = 0 -sm_compound_conditions2.c:49 func(43) aaa = 0 +sm_compound_conditions2.c:15 func() aaa = 2 +sm_compound_conditions2.c:17 func() aaa = 2 +sm_compound_conditions2.c:19 func() aaa = 2 +sm_compound_conditions2.c:22 func() aaa = 0-1 +sm_compound_conditions2.c:24 func() aaa = 1 +sm_compound_conditions2.c:26 func() aaa = 0 +sm_compound_conditions2.c:29 func() aaa = 1-2 +sm_compound_conditions2.c:31 func() aaa = 2 +sm_compound_conditions2.c:33 func() aaa = 1 +sm_compound_conditions2.c:36 func() aaa = 0,2 +sm_compound_conditions2.c:38 func() aaa = 2 +sm_compound_conditions2.c:40 func() aaa = 0 +sm_compound_conditions2.c:43 func() aaa = 2 +sm_compound_conditions2.c:45 func() aaa = 1-2 +sm_compound_conditions2.c:47 func() aaa = 0 +sm_compound_conditions2.c:49 func() aaa = 0 * check-output-end */ diff --git a/validation/sm_compound_conditions3.c b/validation/sm_compound_conditions3.c index ed16dc24..bcc1dc7b 100644 --- a/validation/sm_compound_conditions3.c +++ b/validation/sm_compound_conditions3.c @@ -21,9 +21,9 @@ void func (void) * check-command: smatch -I.. sm_compound_conditions3.c * * check-output-start -sm_compound_conditions3.c:8 func(3) aaa = 1-99 -sm_compound_conditions3.c:10 func(5) aaa = min-0,100-max -sm_compound_conditions3.c:13 func(8) aaa = 1-9 -sm_compound_conditions3.c:16 func(11) aaa = min-0,10-41,43-max +sm_compound_conditions3.c:8 func() aaa = 1-99 +sm_compound_conditions3.c:10 func() aaa = min-0,100-max +sm_compound_conditions3.c:13 func() aaa = 1-9 +sm_compound_conditions3.c:16 func() aaa = min-0,10-41,43-max * check-output-end */ diff --git a/validation/sm_deref_check_deref.c b/validation/sm_deref_check_deref.c index 71217698..978d9e51 100644 --- a/validation/sm_deref_check_deref.c +++ b/validation/sm_deref_check_deref.c @@ -31,7 +31,7 @@ void func (void) * check-command: smatch sm_deref_check_deref.c * * check-output-start -sm_deref_check_deref.c:20 func(9) warn: variable dereferenced before check 'px' (see line 16) -sm_deref_check_deref.c:24 func(13) warn: variable dereferenced before check 'y' (see line 23) +sm_deref_check_deref.c:20 func() warn: variable dereferenced before check 'px' (see line 16) +sm_deref_check_deref.c:24 func() warn: variable dereferenced before check 'y' (see line 23) * check-output-end */ diff --git a/validation/sm_dev_hold.c b/validation/sm_dev_hold.c index 318bb702..0d86ea1d 100644 --- a/validation/sm_dev_hold.c +++ b/validation/sm_dev_hold.c @@ -23,6 +23,6 @@ int func (void) * check-command: smatch --project=kernel sm_dev_hold.c * * check-output-start -sm_dev_hold.c:17 func(10) warn: 'x' held on error path. +sm_dev_hold.c:17 func() warn: 'x' held on error path. * check-output-end */ diff --git a/validation/sm_double_free1.c b/validation/sm_double_free1.c index 8f1f31d9..b2c673a8 100644 --- a/validation/sm_double_free1.c +++ b/validation/sm_double_free1.c @@ -16,6 +16,6 @@ void func (void) * check-command: smatch sm_double_free1.c * * check-output-start -sm_double_free1.c:10 func(7) error: double free of 'x' +sm_double_free1.c:10 func() error: double free of 'x' * check-output-end */ diff --git a/validation/sm_double_free2.c b/validation/sm_double_free2.c index bf357b6c..6335a0b4 100644 --- a/validation/sm_double_free2.c +++ b/validation/sm_double_free2.c @@ -23,6 +23,6 @@ void func (void) * check-command: smatch sm_double_free2.c * * check-output-start -sm_double_free2.c:17 func(10) error: double free of 'x' +sm_double_free2.c:17 func() error: double free of 'x' * check-output-end */ diff --git a/validation/sm_efault.c b/validation/sm_efault.c index 8877ce87..e3d52adb 100644 --- a/validation/sm_efault.c +++ b/validation/sm_efault.c @@ -16,6 +16,6 @@ int func(int *p) * check-command: smatch -p=kernel -I.. sm_efault.c * * check-output-start -sm_efault.c:11 func(6) warn: maybe return -EFAULT instead of the bytes remaining? +sm_efault.c:11 func() warn: maybe return -EFAULT instead of the bytes remaining? * check-output-end */ diff --git a/validation/sm_equiv1.c b/validation/sm_equiv1.c index a4f3e766..3a10dd11 100644 --- a/validation/sm_equiv1.c +++ b/validation/sm_equiv1.c @@ -28,13 +28,13 @@ int func(void) * check-command: smatch -I.. sm_equiv1.c * * check-output-start -sm_equiv1.c:13 func(6) one = 1 -sm_equiv1.c:14 func(7) two = 1 -sm_equiv1.c:16 func(9) one = unknown -sm_equiv1.c:17 func(10) two = unknown -sm_equiv1.c:19 func(12) one = 2 -sm_equiv1.c:20 func(13) two = 2 -sm_equiv1.c:22 func(15) one = unknown -sm_equiv1.c:23 func(16) two = unknown +sm_equiv1.c:13 func() one = 1 +sm_equiv1.c:14 func() two = 1 +sm_equiv1.c:16 func() one = unknown +sm_equiv1.c:17 func() two = unknown +sm_equiv1.c:19 func() one = 2 +sm_equiv1.c:20 func() two = 2 +sm_equiv1.c:22 func() one = unknown +sm_equiv1.c:23 func() two = unknown * check-output-end */ diff --git a/validation/sm_equiv2.c b/validation/sm_equiv2.c index 2cc51b03..d66da29e 100644 --- a/validation/sm_equiv2.c +++ b/validation/sm_equiv2.c @@ -27,9 +27,9 @@ int func(void) * check-command: smatch -I.. sm_equiv2.c * * check-output-start -sm_equiv2.c:18 func(10) red = 5 -sm_equiv2.c:19 func(11) blue = 5 -sm_equiv2.c:21 func(13) red = 0,5 -sm_equiv2.c:22 func(14) blue = 0,5 +sm_equiv2.c:18 func() red = 5 +sm_equiv2.c:19 func() blue = 5 +sm_equiv2.c:21 func() red = 0,5 +sm_equiv2.c:22 func() blue = 0,5 * check-output-end */ diff --git a/validation/sm_equiv3.c b/validation/sm_equiv3.c index 35d893ae..e966731c 100644 --- a/validation/sm_equiv3.c +++ b/validation/sm_equiv3.c @@ -28,7 +28,7 @@ int func(void) * check-command: smatch -I.. sm_equiv3.c * * check-output-start -sm_equiv3.c:22 func(13) red = 0 -sm_equiv3.c:23 func(14) blue = min-(-1),1-max +sm_equiv3.c:22 func() red = 0 +sm_equiv3.c:23 func() blue = min-(-1),1-max * check-output-end */ diff --git a/validation/sm_equiv4.c b/validation/sm_equiv4.c index ec11105d..43b28286 100644 --- a/validation/sm_equiv4.c +++ b/validation/sm_equiv4.c @@ -17,6 +17,6 @@ int func(void) * check-command: smatch -p=kernel -I.. sm_equiv4.c * * check-output-start -sm_equiv4.c:13 func(6) warn: 'b' was not released on error +sm_equiv4.c:13 func() warn: 'b' was not released on error * check-output-end */ diff --git a/validation/sm_err_ptr.c b/validation/sm_err_ptr.c index afa9218c..d89f5d86 100644 --- a/validation/sm_err_ptr.c +++ b/validation/sm_err_ptr.c @@ -20,6 +20,6 @@ int main(void) * check-command: smatch -p=kernel sm_err_ptr.c * * check-output-start -sm_err_ptr.c:14 main(8) error: 'p' dereferencing possible ERR_PTR() +sm_err_ptr.c:14 main() error: 'p' dereferencing possible ERR_PTR() * check-output-end */ diff --git a/validation/sm_get_user1.c b/validation/sm_get_user1.c index a03602cf..989e8957 100644 --- a/validation/sm_get_user1.c +++ b/validation/sm_get_user1.c @@ -30,8 +30,8 @@ void func(void) * check-command: smatch -p=kernel -I.. sm_get_user1.c * * check-output-start -sm_get_user1.c:13 func(7) warn: check for integer over/underflow 'foo' -sm_get_user1.c:18 func(12) warn: check for integer underflow 'bar' -sm_get_user1.c:26 func(20) warn: check for integer overflow 'x' +sm_get_user1.c:13 func() warn: check for integer over/underflow 'foo' +sm_get_user1.c:18 func() warn: check for integer underflow 'bar' +sm_get_user1.c:26 func() warn: check for integer overflow 'x' * check-output-end */ diff --git a/validation/sm_implied.c b/validation/sm_implied.c index c88447d1..60058901 100644 --- a/validation/sm_implied.c +++ b/validation/sm_implied.c @@ -25,6 +25,6 @@ x: * check-command: smatch sm_implied.c * * check-output-start -sm_implied.c:20 func(12) error: potentially derefencing uninitialized 'aa'. +sm_implied.c:20 func() error: potentially derefencing uninitialized 'aa'. * check-output-end */ diff --git a/validation/sm_implied10.c b/validation/sm_implied10.c index 41de4cbc..8ccbbe40 100644 --- a/validation/sm_implied10.c +++ b/validation/sm_implied10.c @@ -22,9 +22,9 @@ void func(int *y) * check-command: smatch -I.. sm_implied10.c * * check-output-start -sm_implied10.c:10 func(3) y = unknown -sm_implied10.c:12 func(5) y = min-(-1),1-max -sm_implied10.c:15 func(8) offset = unknown -sm_implied10.c:17 func(10) offset = min-9 +sm_implied10.c:10 func() y = unknown +sm_implied10.c:12 func() y = min-(-1),1-max +sm_implied10.c:15 func() offset = unknown +sm_implied10.c:17 func() offset = min-9 * check-output-end */ diff --git a/validation/sm_implied2.c b/validation/sm_implied2.c index abae6c2b..ae0b7534 100644 --- a/validation/sm_implied2.c +++ b/validation/sm_implied2.c @@ -36,6 +36,6 @@ void func (void) * check-command: smatch sm_implied2.c * * check-output-start -sm_implied2.c:28 func(19) error: potentially derefencing uninitialized 'aa'. +sm_implied2.c:28 func() error: potentially derefencing uninitialized 'aa'. * check-output-end */ diff --git a/validation/sm_implied4.c b/validation/sm_implied4.c index 6bb18261..1a3435e6 100644 --- a/validation/sm_implied4.c +++ b/validation/sm_implied4.c @@ -30,6 +30,6 @@ int func (void) * check-command: smatch --project=kernel --spammy sm_implied4.c * * check-output-start -sm_implied4.c:22 func(14) warn: 'spin_lock:mylock' is sometimes locked here and sometimes unlocked. +sm_implied4.c:22 func() warn: 'spin_lock:mylock' is sometimes locked here and sometimes unlocked. * check-output-end */ diff --git a/validation/sm_implied5.c b/validation/sm_implied5.c index cf904c37..6ef69436 100644 --- a/validation/sm_implied5.c +++ b/validation/sm_implied5.c @@ -22,6 +22,6 @@ void func (void) * check-command: smatch sm_implied5.c * * check-output-start -sm_implied5.c:18 func(11) error: potentially derefencing uninitialized 'aa'. +sm_implied5.c:18 func() error: potentially derefencing uninitialized 'aa'. * check-output-end */ diff --git a/validation/sm_implied6.c b/validation/sm_implied6.c index 93352760..154ccc50 100644 --- a/validation/sm_implied6.c +++ b/validation/sm_implied6.c @@ -36,6 +36,6 @@ void func (void) * check-command: smatch sm_implied6.c * * check-output-start -sm_implied6.c:29 func(18) error: potential null derefence 'b'. +sm_implied6.c:29 func() error: potential null derefence 'b'. * check-output-end */ diff --git a/validation/sm_implied7.c b/validation/sm_implied7.c index 5de2a875..b6853f40 100644 --- a/validation/sm_implied7.c +++ b/validation/sm_implied7.c @@ -15,8 +15,8 @@ int frob(void) { * check-command: smatch -I.. sm_implied7.c * * check-output-start -sm_implied7.c:7 frob(4) a = unknown -sm_implied7.c:9 frob(6) a = 0 -sm_implied7.c:11 frob(8) a = unknown +sm_implied7.c:7 frob() a = unknown +sm_implied7.c:9 frob() a = 0 +sm_implied7.c:11 frob() a = unknown * check-output-end */ diff --git a/validation/sm_implied8.c b/validation/sm_implied8.c index fd46ebb8..511513dd 100644 --- a/validation/sm_implied8.c +++ b/validation/sm_implied8.c @@ -27,12 +27,12 @@ void func (void) * check-command: smatch -I.. sm_implied8.c * * check-output-start -sm_implied8.c:11 func(5) x = min-(-1),1-max -sm_implied8.c:13 func(7) x = 0 -sm_implied8.c:15 func(9) x = unknown -sm_implied8.c:17 func(11) x = min-2,4-max -sm_implied8.c:19 func(13) x = 3 -sm_implied8.c:22 func(16) x = min-9,11-max -sm_implied8.c:23 func(17) x = unknown +sm_implied8.c:11 func() x = min-(-1),1-max +sm_implied8.c:13 func() x = 0 +sm_implied8.c:15 func() x = unknown +sm_implied8.c:17 func() x = min-2,4-max +sm_implied8.c:19 func() x = 3 +sm_implied8.c:22 func() x = min-9,11-max +sm_implied8.c:23 func() x = unknown * check-output-end */ diff --git a/validation/sm_implied9.c b/validation/sm_implied9.c index 4275885d..78652692 100644 --- a/validation/sm_implied9.c +++ b/validation/sm_implied9.c @@ -25,10 +25,10 @@ void func(int y) * check-command: smatch -I.. sm_implied9.c * * check-output-start -sm_implied9.c:10 func(5) y = min-(-1),10-max -sm_implied9.c:12 func(7) y = 0-9 -sm_implied9.c:16 func(11) y = min-2,5-max -sm_implied9.c:18 func(13) y = 3-4 -sm_implied9.c:21 func(16) y = min-(-99) +sm_implied9.c:10 func() y = min-(-1),10-max +sm_implied9.c:12 func() y = 0-9 +sm_implied9.c:16 func() y = min-2,5-max +sm_implied9.c:18 func() y = 3-4 +sm_implied9.c:21 func() y = min-(-99) * check-output-end */ diff --git a/validation/sm_locking.c b/validation/sm_locking.c index f3403f14..d335ad3b 100644 --- a/validation/sm_locking.c +++ b/validation/sm_locking.c @@ -30,7 +30,7 @@ int func (void) * check-command: smatch --project=kernel --spammy sm_locking.c * * check-output-start -sm_locking.c:26 func(20) warn: 'spin_lock:mylock3' is sometimes locked here and sometimes unlocked. -sm_locking.c:26 func(20) warn: inconsistent returns spin_lock:mylock2: locked (13,26) unlocked (21) +sm_locking.c:26 func() warn: 'spin_lock:mylock3' is sometimes locked here and sometimes unlocked. +sm_locking.c:26 func() warn: inconsistent returns spin_lock:mylock2: locked (13,26) unlocked (21) * check-output-end */ diff --git a/validation/sm_locking2.c b/validation/sm_locking2.c index 1755be55..e3984c10 100644 --- a/validation/sm_locking2.c +++ b/validation/sm_locking2.c @@ -30,7 +30,7 @@ int func (void) * check-command: smatch --project=kernel sm_locking2.c * * check-output-start -sm_locking2.c:21 func(14) error: double unlock 'spin_lock:mylock' -sm_locking2.c:26 func(19) warn: inconsistent returns spin_lock:mylock3: locked (26) unlocked (14,25) +sm_locking2.c:21 func() error: double unlock 'spin_lock:mylock' +sm_locking2.c:26 func() warn: inconsistent returns spin_lock:mylock3: locked (26) unlocked (14,25) * check-output-end */ diff --git a/validation/sm_locking3.c b/validation/sm_locking3.c index 7e245f17..9f4a8f2e 100644 --- a/validation/sm_locking3.c +++ b/validation/sm_locking3.c @@ -24,7 +24,7 @@ int func (void) * check-command: smatch --project=kernel sm_locking3.c * * check-output-start -sm_locking3.c:18 func(13) error: double unlock 'spin_lock:mylock' -sm_locking3.c:20 func(15) warn: inconsistent returns spin_lock:mylock: locked (16) unlocked (10,20) +sm_locking3.c:18 func() error: double unlock 'spin_lock:mylock' +sm_locking3.c:20 func() warn: inconsistent returns spin_lock:mylock: locked (16) unlocked (10,20) * check-output-end */ diff --git a/validation/sm_locking4.c b/validation/sm_locking4.c index b5d319de..088fdf56 100644 --- a/validation/sm_locking4.c +++ b/validation/sm_locking4.c @@ -29,6 +29,6 @@ int func (void) * check-command: smatch --project=kernel sm_locking4.c * * check-output-start -sm_locking4.c:25 func(18) warn: inconsistent returns spin_lock:mylock: locked (22,25) unlocked (16) +sm_locking4.c:25 func() warn: inconsistent returns spin_lock:mylock: locked (22,25) unlocked (16) * check-output-end */ diff --git a/validation/sm_locking6.c b/validation/sm_locking6.c index 941cec4e..1ac4816c 100644 --- a/validation/sm_locking6.c +++ b/validation/sm_locking6.c @@ -31,7 +31,7 @@ void func (void) * check-command: smatch -p=kernel sm_locking6.c * * check-output-start -sm_locking6.c:27 func(12) warn: inconsistent returns irqsave:flags: locked (26) unlocked (21,24,27) -sm_locking6.c:27 func(12) warn: inconsistent returns spin_lock:lock: locked (26) unlocked (21,24,27) +sm_locking6.c:27 func() warn: inconsistent returns irqsave:flags: locked (26) unlocked (21,24,27) +sm_locking6.c:27 func() warn: inconsistent returns spin_lock:lock: locked (26) unlocked (21,24,27) * check-output-end */ diff --git a/validation/sm_loops1.c b/validation/sm_loops1.c index 6a138fa8..03b1dfd9 100644 --- a/validation/sm_loops1.c +++ b/validation/sm_loops1.c @@ -25,13 +25,13 @@ void func(int *x) * check-command: smatch -I.. sm_loops1.c * * check-output-start -sm_loops1.c:10 func(5) a = 0-9 -sm_loops1.c:11 func(6) a = 10 -sm_loops1.c:13 func(8) a = empty -sm_loops1.c:14 func(9) a = 10 -sm_loops1.c:16 func(11) a = 0-9 -sm_loops1.c:17 func(12) a = 10 -sm_loops1.c:19 func(14) a = 0-10 -sm_loops1.c:20 func(15) a = 11 +sm_loops1.c:10 func() a = 0-9 +sm_loops1.c:11 func() a = 10 +sm_loops1.c:13 func() a = empty +sm_loops1.c:14 func() a = 10 +sm_loops1.c:16 func() a = 0-9 +sm_loops1.c:17 func() a = 10 +sm_loops1.c:19 func() a = 0-10 +sm_loops1.c:20 func() a = 11 * check-output-end */ diff --git a/validation/sm_loops2.c b/validation/sm_loops2.c index 59753d80..a10a4f4b 100644 --- a/validation/sm_loops2.c +++ b/validation/sm_loops2.c @@ -31,14 +31,14 @@ void func(void) * check-command: smatch -I.. sm_loops2.c * * check-output-start -sm_loops2.c:10 func(3) x = unknown -sm_loops2.c:11 func(4) x = unknown -sm_loops2.c:16 func(9) x = 0-max -sm_loops2.c:18 func(11) x = 0-max -sm_loops2.c:19 func(12) x = (-1) -sm_loops2.c:22 func(15) x = 0-9 -sm_loops2.c:23 func(16) x = (-1) -sm_loops2.c:26 func(19) x = 1-9 -sm_loops2.c:27 func(20) x = 0 +sm_loops2.c:10 func() x = unknown +sm_loops2.c:11 func() x = unknown +sm_loops2.c:16 func() x = 0-max +sm_loops2.c:18 func() x = 0-max +sm_loops2.c:19 func() x = (-1) +sm_loops2.c:22 func() x = 0-9 +sm_loops2.c:23 func() x = (-1) +sm_loops2.c:26 func() x = 1-9 +sm_loops2.c:27 func() x = 0 * check-output-end */ diff --git a/validation/sm_loops3.c b/validation/sm_loops3.c index 0dab5a5e..dcee5d8d 100644 --- a/validation/sm_loops3.c +++ b/validation/sm_loops3.c @@ -25,6 +25,6 @@ void func(void) * check-command: smatch -I.. sm_loops3.c * * check-output-start -sm_loops3.c:19 func(12) x = 1 +sm_loops3.c:19 func() x = 1 * check-output-end */ diff --git a/validation/sm_loops4.c b/validation/sm_loops4.c index 0b3e8c30..308a8592 100644 --- a/validation/sm_loops4.c +++ b/validation/sm_loops4.c @@ -25,6 +25,6 @@ void func(void) * check-command: smatch -I.. sm_loops4.c * * check-output-start -sm_loops4.c:16 func(9) error: potentially derefencing uninitialized 'p'. +sm_loops4.c:16 func() error: potentially derefencing uninitialized 'p'. * check-output-end */ diff --git a/validation/sm_macros.c b/validation/sm_macros.c index db13c4fc..73d55249 100644 --- a/validation/sm_macros.c +++ b/validation/sm_macros.c @@ -21,11 +21,11 @@ void func(int *p) * check-command: smatch -I.. sm_macros.c * * check-output-start -sm_macros.c:11 func(5) warn: the 'add' macro might need parens -sm_macros.c:13 func(7) warn: the 'add' macro might need parens -sm_macros.c:13 func(7) warn: the 'add' macro might need parens -sm_macros.c:14 func(8) warn: the 'add' macro might need parens -sm_macros.c:16 func(10) warn: the 'sub' macro might need parens -sm_macros.c:17 func(11) warn: the 'sub' macro might need parens +sm_macros.c:11 func() warn: the 'add' macro might need parens +sm_macros.c:13 func() warn: the 'add' macro might need parens +sm_macros.c:13 func() warn: the 'add' macro might need parens +sm_macros.c:14 func() warn: the 'add' macro might need parens +sm_macros.c:16 func() warn: the 'sub' macro might need parens +sm_macros.c:17 func() warn: the 'sub' macro might need parens * check-output-end */ diff --git a/validation/sm_math1.c b/validation/sm_math1.c index 99f07fb7..8764bb91 100644 --- a/validation/sm_math1.c +++ b/validation/sm_math1.c @@ -28,10 +28,10 @@ label_I1: * check-command: smatch -I.. sm_math1.c * * check-output-start -sm_math1.c:13 func(8) y = (-58) -sm_math1.c:16 func(11) y = (-57)-max -sm_math1.c:19 func(14) z = 7-max -sm_math1.c:20 func(15) x = 2 -sm_math1.c:23 func(18) x = min-1 +sm_math1.c:13 func() y = (-58) +sm_math1.c:16 func() y = (-57)-max +sm_math1.c:19 func() z = 7-max +sm_math1.c:20 func() x = 2 +sm_math1.c:23 func() x = min-1 * check-output-end */ diff --git a/validation/sm_memleak2.c b/validation/sm_memleak2.c index 0befe044..a6a0df85 100644 --- a/validation/sm_memleak2.c +++ b/validation/sm_memleak2.c @@ -14,6 +14,6 @@ void func (void) * check-command: smatch sm_memleak2.c * * check-output-start -sm_memleak2.c:8 func(5) warn: overwrite may leak 'ptr' +sm_memleak2.c:8 func() warn: overwrite may leak 'ptr' * check-output-end */ diff --git a/validation/sm_memory.c b/validation/sm_memory.c index b1c1a21d..8aa3e963 100644 --- a/validation/sm_memory.c +++ b/validation/sm_memory.c @@ -28,6 +28,6 @@ void func (void) * check-command: smatch sm_memory.c * * check-output-start -sm_memory.c:21 func(12) warn: possible memory leak of 'ac' +sm_memory.c:21 func() warn: possible memory leak of 'ac' * check-output-end */ diff --git a/validation/sm_netdevice.c b/validation/sm_netdevice.c index c3cac33c..34cf1375 100644 --- a/validation/sm_netdevice.c +++ b/validation/sm_netdevice.c @@ -25,7 +25,7 @@ void func(void) * check-command: smatch -p=kernel sm_netdevice.c * * check-output-start -sm_netdevice.c:17 func(9) error: use free_netdev() here instead of kfree(dev2) -sm_netdevice.c:19 func(11) error: use free_netdev() here instead of kfree(deva[0]) +sm_netdevice.c:17 func() error: use free_netdev() here instead of kfree(dev2) +sm_netdevice.c:19 func() error: use free_netdev() here instead of kfree(deva[0]) * check-output-end */ diff --git a/validation/sm_null_deref.c b/validation/sm_null_deref.c index baf7e3b5..63b32d04 100644 --- a/validation/sm_null_deref.c +++ b/validation/sm_null_deref.c @@ -53,11 +53,11 @@ static void func (void) * check-command: smatch sm_null_deref.c * * check-output-start -sm_null_deref.c:18 func(6) error: potentially derefencing uninitialized 'aa'. -sm_null_deref.c:23 func(11) error: we previously assumed 'a' could be null (see line 20) -sm_null_deref.c:25 func(13) warn: variable dereferenced before check 'a' (see line 23) -sm_null_deref.c:30 func(18) error: we previously assumed 'b' could be null (see line 25) -sm_null_deref.c:48 func(36) error: potential null derefence 'd'. +sm_null_deref.c:18 func() error: potentially derefencing uninitialized 'aa'. +sm_null_deref.c:23 func() error: we previously assumed 'a' could be null (see line 20) +sm_null_deref.c:25 func() warn: variable dereferenced before check 'a' (see line 23) +sm_null_deref.c:30 func() error: we previously assumed 'b' could be null (see line 25) +sm_null_deref.c:48 func() error: potential null derefence 'd'. * check-output-end */ diff --git a/validation/sm_null_deref2.c b/validation/sm_null_deref2.c index b6ef6e2d..94c38dea 100644 --- a/validation/sm_null_deref2.c +++ b/validation/sm_null_deref2.c @@ -19,6 +19,6 @@ void frob(void) { * check-command: smatch sm_null_deref2.c * * check-output-start -sm_null_deref2.c:15 frob(12) error: we previously assumed 'ptr' could be null (see line 12) +sm_null_deref2.c:15 frob() error: we previously assumed 'ptr' could be null (see line 12) * check-output-end */ diff --git a/validation/sm_overflow.c b/validation/sm_overflow.c index 0ab95a18..c4f33a87 100644 --- a/validation/sm_overflow.c +++ b/validation/sm_overflow.c @@ -22,6 +22,6 @@ int main(int argc, char* argv[]) * check-command: smatch sm_overflow.c * * check-output-start -sm_overflow.c:15 main(5) error: buffer overflow 'b1.a.b' 8 <= 10 +sm_overflow.c:15 main() error: buffer overflow 'b1.a.b' 8 <= 10 * check-output-end */ diff --git a/validation/sm_overflow3.c b/validation/sm_overflow3.c index a396c783..dee0a081 100644 --- a/validation/sm_overflow3.c +++ b/validation/sm_overflow3.c @@ -23,8 +23,8 @@ void func (char *a, char *b) * check-command: smatch -I.. sm_overflow3.c * * check-output-start -sm_overflow3.c:14 func(9) error: buffer overflow 'a' 5 <= 5 -sm_overflow3.c:15 func(10) error: strcpy() 'b' too large for 'c' (5 vs 4) -sm_overflow3.c:17 func(12) error: strcpy() '"1234"' too large for 'e' (5 vs 4) +sm_overflow3.c:14 func() error: buffer overflow 'a' 5 <= 5 +sm_overflow3.c:15 func() error: strcpy() 'b' too large for 'c' (5 vs 4) +sm_overflow3.c:17 func() error: strcpy() '"1234"' too large for 'e' (5 vs 4) * check-output-end */ diff --git a/validation/sm_overflow4.c b/validation/sm_overflow4.c index 432f288d..2d8c9e58 100644 --- a/validation/sm_overflow4.c +++ b/validation/sm_overflow4.c @@ -15,6 +15,6 @@ void func (char *a, char *b) * check-command: smatch -I.. sm_overflow4.c * * check-output-start -sm_overflow4.c:11 func(5) error: strcpy() 'a' too large for 'c' (6 vs 5) +sm_overflow4.c:11 func() error: strcpy() 'a' too large for 'c' (6 vs 5) * check-output-end */ diff --git a/validation/sm_overflow5.c b/validation/sm_overflow5.c index 1d39e630..e930e50a 100644 --- a/validation/sm_overflow5.c +++ b/validation/sm_overflow5.c @@ -16,6 +16,6 @@ void func (char *a, char *b) * check-command: smatch -I.. sm_overflow5.c * * check-output-start -sm_overflow5.c:12 func(6) error: buffer overflow 'a' 5 <= 5 +sm_overflow5.c:12 func() error: buffer overflow 'a' 5 <= 5 * check-output-end */ diff --git a/validation/sm_overflow6.c b/validation/sm_overflow6.c index 13e8de5b..7b553476 100644 --- a/validation/sm_overflow6.c +++ b/validation/sm_overflow6.c @@ -22,8 +22,8 @@ int main(void) * check-command: smatch -I.. sm_overflow6.c * * check-output-start -sm_overflow6.c:17 main(7) error: snprintf() is printing too much 11 vs 10 -sm_overflow6.c:17 main(7) error: snprintf() chops off the last chars of 'str': 12 vs 11 -sm_overflow6.c:18 main(8) error: sprintf() copies too much data from 'str': 12 vs 10 +sm_overflow6.c:17 main() error: snprintf() is printing too much 11 vs 10 +sm_overflow6.c:17 main() error: snprintf() chops off the last chars of 'str': 12 vs 11 +sm_overflow6.c:18 main() error: sprintf() copies too much data from 'str': 12 vs 10 * check-output-end */ diff --git a/validation/sm_precedence.c b/validation/sm_precedence.c index 1cd3a8e0..42b965ea 100644 --- a/validation/sm_precedence.c +++ b/validation/sm_precedence.c @@ -33,11 +33,11 @@ static int options_write(void) * check-command: smatch sm_precedence.c * * check-output-start -sm_precedence.c:10 options_write(2) warn: add some parenthesis here? -sm_precedence.c:12 options_write(4) warn: add some parenthesis here? -sm_precedence.c:14 options_write(6) warn: add some parenthesis here? -sm_precedence.c:16 options_write(8) warn: add some parenthesis here? -sm_precedence.c:18 options_write(10) warn: add some parenthesis here? -sm_precedence.c:20 options_write(12) warn: add some parenthesis here? +sm_precedence.c:10 options_write() warn: add some parenthesis here? +sm_precedence.c:12 options_write() warn: add some parenthesis here? +sm_precedence.c:14 options_write() warn: add some parenthesis here? +sm_precedence.c:16 options_write() warn: add some parenthesis here? +sm_precedence.c:18 options_write() warn: add some parenthesis here? +sm_precedence.c:20 options_write() warn: add some parenthesis here? * check-output-end */ diff --git a/validation/sm_propagate.c b/validation/sm_propagate.c index a35e6b06..f07d6f42 100644 --- a/validation/sm_propagate.c +++ b/validation/sm_propagate.c @@ -16,6 +16,6 @@ int func(int *p) * check-command: smatch -p=kernel -I.. sm_propagate.c * * check-output-start -sm_propagate.c:11 func(6) info: why not propagate 'ret' from frob() instead of -1? +sm_propagate.c:11 func() info: why not propagate 'ret' from frob() instead of -1? * check-output-end */ diff --git a/validation/sm_range2.c b/validation/sm_range2.c index 9b3e7d06..1b5955e1 100644 --- a/validation/sm_range2.c +++ b/validation/sm_range2.c @@ -30,14 +30,14 @@ int frob(void) { * check-command: smatch -I.. sm_range2.c * * check-output-start -sm_range2.c:6 frob(2) a = min-(-1),1-max -sm_range2.c:8 frob(4) a = 0 -sm_range2.c:9 frob(5) a = unknown -sm_range2.c:12 frob(8) b = 0 -sm_range2.c:14 frob(10) b = unknown -sm_range2.c:17 frob(13) c = unknown -sm_range2.c:20 frob(16) d = (-3)-99 -sm_range2.c:25 frob(21) d = (-3)-99 -sm_range2.c:26 frob(22) e = unknown +sm_range2.c:6 frob() a = min-(-1),1-max +sm_range2.c:8 frob() a = 0 +sm_range2.c:9 frob() a = unknown +sm_range2.c:12 frob() b = 0 +sm_range2.c:14 frob() b = unknown +sm_range2.c:17 frob() c = unknown +sm_range2.c:20 frob() d = (-3)-99 +sm_range2.c:25 frob() d = (-3)-99 +sm_range2.c:26 frob() e = unknown * check-output-end */ diff --git a/validation/sm_range3.c b/validation/sm_range3.c index acda5b07..d33b784b 100644 --- a/validation/sm_range3.c +++ b/validation/sm_range3.c @@ -61,25 +61,25 @@ void func(void) * check-command: smatch -I.. sm_range3.c * * check-output-start -sm_range3.c:8 func(4) x = min-0 -sm_range3.c:10 func(6) x = 1-max -sm_range3.c:13 func(9) x = 13-max -sm_range3.c:15 func(11) x = min-12 -sm_range3.c:18 func(14) x = min-23 -sm_range3.c:20 func(16) x = 24-max -sm_range3.c:23 func(19) x = 34-max -sm_range3.c:25 func(21) x = min-33 -sm_range3.c:28 func(24) x = 45-max -sm_range3.c:30 func(26) x = min-44 -sm_range3.c:33 func(29) x = min-56 -sm_range3.c:35 func(31) x = 57-max -sm_range3.c:38 func(34) x = 68-max -sm_range3.c:40 func(36) x = min-67 -sm_range3.c:43 func(39) x = min-77 -sm_range3.c:45 func(41) x = 78-max -sm_range3.c:48 func(44) x = 89 -sm_range3.c:50 func(46) x = min-88,90-max -sm_range3.c:53 func(49) x = min-99,101-max -sm_range3.c:55 func(51) x = 100 +sm_range3.c:8 func() x = min-0 +sm_range3.c:10 func() x = 1-max +sm_range3.c:13 func() x = 13-max +sm_range3.c:15 func() x = min-12 +sm_range3.c:18 func() x = min-23 +sm_range3.c:20 func() x = 24-max +sm_range3.c:23 func() x = 34-max +sm_range3.c:25 func() x = min-33 +sm_range3.c:28 func() x = 45-max +sm_range3.c:30 func() x = min-44 +sm_range3.c:33 func() x = min-56 +sm_range3.c:35 func() x = 57-max +sm_range3.c:38 func() x = 68-max +sm_range3.c:40 func() x = min-67 +sm_range3.c:43 func() x = min-77 +sm_range3.c:45 func() x = 78-max +sm_range3.c:48 func() x = 89 +sm_range3.c:50 func() x = min-88,90-max +sm_range3.c:53 func() x = min-99,101-max +sm_range3.c:55 func() x = 100 * check-output-end */ diff --git a/validation/sm_range4.c b/validation/sm_range4.c index 63670f56..af6d92c2 100644 --- a/validation/sm_range4.c +++ b/validation/sm_range4.c @@ -27,11 +27,11 @@ static int frob(void) * check-command: smatch -I.. sm_range4.c * * check-output-start -sm_range4.c:8 frob(3) a = 6-max -sm_range4.c:12 frob(7) b = 7-max -sm_range4.c:16 frob(11) c = 6-max -sm_range4.c:19 frob(14) a = min-5 -sm_range4.c:20 frob(15) b = min-6 -sm_range4.c:21 frob(16) c = min-5 +sm_range4.c:8 frob() a = 6-max +sm_range4.c:12 frob() b = 7-max +sm_range4.c:16 frob() c = 6-max +sm_range4.c:19 frob() a = min-5 +sm_range4.c:20 frob() b = min-6 +sm_range4.c:21 frob() c = min-5 * check-output-end */ diff --git a/validation/sm_redundant_check.c b/validation/sm_redundant_check.c index 27d26d0b..569df631 100644 --- a/validation/sm_redundant_check.c +++ b/validation/sm_redundant_check.c @@ -20,7 +20,7 @@ void func (void) * check-command: smatch sm_redundant_check.c * * check-output-start -sm_redundant_check.c:8 func(3) info: redundant null check on x calling free() -sm_redundant_check.c:13 func(8) info: redundant null check on z calling free() +sm_redundant_check.c:8 func() info: redundant null check on x calling free() +sm_redundant_check.c:13 func() info: redundant null check on z calling free() * check-output-end */ diff --git a/validation/sm_rosenberg.c b/validation/sm_rosenberg.c index cc9c37c3..8bf3bdcf 100644 --- a/validation/sm_rosenberg.c +++ b/validation/sm_rosenberg.c @@ -67,9 +67,9 @@ int main(void) * check-command: smatch -p=kernel -I.. sm_rosenberg.c * * check-output-start -sm_rosenberg.c:54 main(28) warn: check that 'one' doesn't leak information (struct has holes) -sm_rosenberg.c:56 main(30) warn: check that 'three' doesn't leak information (struct has holes) -sm_rosenberg.c:57 main(31) warn: check that 'four.y' doesn't leak information -sm_rosenberg.c:62 main(36) warn: check that 'nine.x' doesn't leak information +sm_rosenberg.c:54 main() warn: check that 'one' doesn't leak information (struct has holes) +sm_rosenberg.c:56 main() warn: check that 'three' doesn't leak information (struct has holes) +sm_rosenberg.c:57 main() warn: check that 'four.y' doesn't leak information +sm_rosenberg.c:62 main() warn: check that 'nine.x' doesn't leak information * check-output-end */ diff --git a/validation/sm_select.c b/validation/sm_select.c index bd1f22aa..546fdb7f 100644 --- a/validation/sm_select.c +++ b/validation/sm_select.c @@ -31,11 +31,11 @@ void func (void) * check-command: smatch sm_select.c * * check-output-start -sm_select.c:17 func(6) error: we previously assumed 'a' could be null (see line 13) -sm_select.c:18 func(7) error: we previously assumed 'b' could be null (see line 13) -sm_select.c:21 func(10) warn: variable dereferenced before check 'e' (see line 19) -sm_select.c:22 func(11) error: we previously assumed 'c' could be null (see line 21) -sm_select.c:26 func(15) error: we previously assumed 'e' could be null (see line 21) +sm_select.c:17 func() error: we previously assumed 'a' could be null (see line 13) +sm_select.c:18 func() error: we previously assumed 'b' could be null (see line 13) +sm_select.c:21 func() warn: variable dereferenced before check 'e' (see line 19) +sm_select.c:22 func() error: we previously assumed 'c' could be null (see line 21) +sm_select.c:26 func() error: we previously assumed 'e' could be null (see line 21) * check-output-end */ diff --git a/validation/sm_select2.c b/validation/sm_select2.c index 7d25397c..2af18b85 100644 --- a/validation/sm_select2.c +++ b/validation/sm_select2.c @@ -17,6 +17,6 @@ int func(void) * check-command: smatch -I.. sm_select2.c * * check-output-start -sm_select2.c:13 func(7) sd = min-(-1),1-max +sm_select2.c:13 func() sd = min-(-1),1-max * check-output-end */ diff --git a/validation/sm_select3.c b/validation/sm_select3.c index 8d872406..7fe36bde 100644 --- a/validation/sm_select3.c +++ b/validation/sm_select3.c @@ -69,36 +69,36 @@ int func(void) * check-command: smatch -I.. sm_select3.c * * check-output-start -sm_select3.c:7 func(3) a = unknown -sm_select3.c:9 func(5) Test #1 a ? 1 : c -sm_select3.c:11 func(7) a = unknown -sm_select3.c:12 func(8) c = unknown -sm_select3.c:14 func(10) c = min-(-1),1-max -sm_select3.c:16 func(12) a = min-(-1),1-max -sm_select3.c:18 func(14) a = 0 -sm_select3.c:19 func(15) c = 0 -sm_select3.c:22 func(18) Test #2 a ? 0 : c -sm_select3.c:24 func(20) a = 0 -sm_select3.c:25 func(21) c = min-(-1),1-max -sm_select3.c:27 func(23) c = min-(-1),1-max -sm_select3.c:29 func(25) a = unknown -sm_select3.c:30 func(26) c = unknown -sm_select3.c:32 func(28) c = 0 -sm_select3.c:34 func(30) a = unknown -sm_select3.c:37 func(33) Test #3 a ? b : 1 -sm_select3.c:39 func(35) a = unknown -sm_select3.c:40 func(36) b = unknown -sm_select3.c:42 func(38) b = unknown -sm_select3.c:44 func(40) a = 0 -sm_select3.c:46 func(42) a = min-(-1),1-max -sm_select3.c:47 func(43) b = 0 -sm_select3.c:49 func(45) a = min-(-1),1-max -sm_select3.c:52 func(48) Test #2 a ? b : 0 -sm_select3.c:54 func(50) a = min-(-1),1-max -sm_select3.c:55 func(51) b = min-(-1),1-max -sm_select3.c:57 func(53) a = unknown -sm_select3.c:58 func(54) b = unknown -sm_select3.c:60 func(56) b = 0 -sm_select3.c:62 func(58) a = 0 +sm_select3.c:7 func() a = unknown +sm_select3.c:9 func() Test #1 a ? 1 : c +sm_select3.c:11 func() a = unknown +sm_select3.c:12 func() c = unknown +sm_select3.c:14 func() c = min-(-1),1-max +sm_select3.c:16 func() a = min-(-1),1-max +sm_select3.c:18 func() a = 0 +sm_select3.c:19 func() c = 0 +sm_select3.c:22 func() Test #2 a ? 0 : c +sm_select3.c:24 func() a = 0 +sm_select3.c:25 func() c = min-(-1),1-max +sm_select3.c:27 func() c = min-(-1),1-max +sm_select3.c:29 func() a = unknown +sm_select3.c:30 func() c = unknown +sm_select3.c:32 func() c = 0 +sm_select3.c:34 func() a = unknown +sm_select3.c:37 func() Test #3 a ? b : 1 +sm_select3.c:39 func() a = unknown +sm_select3.c:40 func() b = unknown +sm_select3.c:42 func() b = unknown +sm_select3.c:44 func() a = 0 +sm_select3.c:46 func() a = min-(-1),1-max +sm_select3.c:47 func() b = 0 +sm_select3.c:49 func() a = min-(-1),1-max +sm_select3.c:52 func() Test #2 a ? b : 0 +sm_select3.c:54 func() a = min-(-1),1-max +sm_select3.c:55 func() b = min-(-1),1-max +sm_select3.c:57 func() a = unknown +sm_select3.c:58 func() b = unknown +sm_select3.c:60 func() b = 0 +sm_select3.c:62 func() a = 0 * check-output-end */ diff --git a/validation/sm_select4.c b/validation/sm_select4.c index fc40996a..ae8a4c72 100644 --- a/validation/sm_select4.c +++ b/validation/sm_select4.c @@ -18,8 +18,8 @@ void func(unsigned long x) * check-command: smatch -I.. sm_select4.c * * check-output-start -sm_select4.c:11 func(5) x = min-3 -sm_select4.c:13 func(7) x = min-3 -sm_select4.c:14 func(8) x = min-3 +sm_select4.c:11 func() x = min-3 +sm_select4.c:13 func() x = min-3 +sm_select4.c:14 func() x = min-3 * check-output-end */ diff --git a/validation/sm_select_assign.c b/validation/sm_select_assign.c index 4865ce54..42f7176b 100644 --- a/validation/sm_select_assign.c +++ b/validation/sm_select_assign.c @@ -30,9 +30,9 @@ void func(void) * check-command: smatch -I.. sm_select_assign.c * * check-output-start -sm_select_assign.c:14 func(7) val = 0-5 -sm_select_assign.c:18 func(11) i = 11-max -sm_select_assign.c:20 func(13) val = 11-100 -sm_select_assign.c:26 func(19) val = 10 +sm_select_assign.c:14 func() val = 0-5 +sm_select_assign.c:18 func() i = 11-max +sm_select_assign.c:20 func() val = 11-100 +sm_select_assign.c:26 func() val = 10 * check-output-end */ diff --git a/validation/sm_skb.c b/validation/sm_skb.c index 569a6e37..ccd738c0 100644 --- a/validation/sm_skb.c +++ b/validation/sm_skb.c @@ -46,10 +46,10 @@ void func (void) * check-command: smatch -p=kernel sm_skb.c * * check-output-start -sm_skb.c:34 func(2) error: use kfree_skb() here instead of kfree(skb) -sm_skb.c:35 func(3) error: use kfree_skb() here instead of kfree(x->skb) -sm_skb.c:36 func(4) error: use kfree_skb() here instead of kfree(xx.skb) -sm_skb.c:38 func(6) error: use kfree_skb() here instead of kfree(u->a->skb) -sm_skb.c:40 func(8) error: use kfree_skb() here instead of kfree(y->b->a->skb) +sm_skb.c:34 func() error: use kfree_skb() here instead of kfree(skb) +sm_skb.c:35 func() error: use kfree_skb() here instead of kfree(x->skb) +sm_skb.c:36 func() error: use kfree_skb() here instead of kfree(xx.skb) +sm_skb.c:38 func() error: use kfree_skb() here instead of kfree(u->a->skb) +sm_skb.c:40 func() error: use kfree_skb() here instead of kfree(y->b->a->skb) * check-output-end */ diff --git a/validation/sm_strlen.c b/validation/sm_strlen.c index dd8b1b25..b5019a0f 100644 --- a/validation/sm_strlen.c +++ b/validation/sm_strlen.c @@ -19,6 +19,6 @@ void func (char *input) * check-command: smatch sm_strlen.c * * check-output-start -sm_strlen.c:11 func(7) error: strcpy() 'input' too large for 'buf' (6 vs 4) +sm_strlen.c:11 func() error: strcpy() 'input' too large for 'buf' (6 vs 4) * check-output-end */ diff --git a/validation/sm_strlen2.c b/validation/sm_strlen2.c index e6e24807..02a13b1c 100644 --- a/validation/sm_strlen2.c +++ b/validation/sm_strlen2.c @@ -20,8 +20,8 @@ void func (char *input1, char *input2, char *input3) * check-command: smatch sm_strlen2.c * * check-output-start -sm_strlen2.c:10 func(6) error: strcpy() 'input1' too large for 'buf' (5 vs 4) -sm_strlen2.c:13 func(9) error: strcpy() 'input2' too large for 'buf' (10 vs 4) -sm_strlen2.c:16 func(12) error: strcpy() 'input3' too large for 'buf' (5 vs 4) +sm_strlen2.c:10 func() error: strcpy() 'input1' too large for 'buf' (5 vs 4) +sm_strlen2.c:13 func() error: strcpy() 'input2' too large for 'buf' (10 vs 4) +sm_strlen2.c:16 func() error: strcpy() 'input3' too large for 'buf' (5 vs 4) * check-output-end */ diff --git a/validation/sm_switch.c b/validation/sm_switch.c index 9d206643..f4b91315 100644 --- a/validation/sm_switch.c +++ b/validation/sm_switch.c @@ -52,7 +52,7 @@ void func (void) * check-known-to-fail * * check-output-start -sm_switch.c:38 func(25) error: potential null derefence 'a'. -sm_switch.c:39 func(26) error: potential null derefence 'b'. +sm_switch.c:38 func() error: potential null derefence 'a'. +sm_switch.c:39 func() error: potential null derefence 'b'. * check-output-end */ diff --git a/validation/sm_switch2.c b/validation/sm_switch2.c index 05b98165..4a949e15 100644 --- a/validation/sm_switch2.c +++ b/validation/sm_switch2.c @@ -44,7 +44,7 @@ void func (void) * check-command: smatch sm_switch2.c * * check-output-start -sm_switch2.c:31 func(20) error: potential null derefence 'a'. -sm_switch2.c:32 func(21) error: potential null derefence 'b'. +sm_switch2.c:31 func() error: potential null derefence 'a'. +sm_switch2.c:32 func() error: potential null derefence 'b'. * check-output-end */ diff --git a/validation/sm_wine_filehandles.c b/validation/sm_wine_filehandles.c index 916ccd18..2b6ee445 100644 --- a/validation/sm_wine_filehandles.c +++ b/validation/sm_wine_filehandles.c @@ -20,7 +20,7 @@ int func (void) * check-command: smatch -p=wine sm_wine_filehandles.c * * check-output-start -sm_wine_filehandles.c:8 func(4) error: comparing a filehandle against zero 'x' -sm_wine_filehandles.c:13 func(9) error: comparing a filehandle against zero 'x' +sm_wine_filehandles.c:8 func() error: comparing a filehandle against zero 'x' +sm_wine_filehandles.c:13 func() error: comparing a filehandle against zero 'x' * check-output-end */ diff --git a/validation/sm_wine_locking.c b/validation/sm_wine_locking.c index 07b479f8..a136d15b 100644 --- a/validation/sm_wine_locking.c +++ b/validation/sm_wine_locking.c @@ -37,8 +37,8 @@ void test1(void) * check-command: smatch -p=wine --spammy sm_wine_locking.c * * check-output-start -sm_wine_locking.c:28 test1(18) error: double unlock 'create_window_handle:b' -sm_wine_locking.c:30 test1(20) warn: 'CriticalSection:c' is sometimes locked here and sometimes unlocked. -sm_wine_locking.c:33 test1(23) warn: inconsistent returns USER_Lock:: locked (30) unlocked (33) +sm_wine_locking.c:28 test1() error: double unlock 'create_window_handle:b' +sm_wine_locking.c:30 test1() warn: 'CriticalSection:c' is sometimes locked here and sometimes unlocked. +sm_wine_locking.c:33 test1() warn: inconsistent returns USER_Lock:: locked (30) unlocked (33) * check-output-end */ -- 2.11.4.GIT