diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-08-22 12:01:06 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-08-22 12:01:06 +0000 |
| commit | 2eeb06d4319586a0633839bcb1704f78fd2b1977 (patch) | |
| tree | 8ed3cfe6e27099243a3bae325df81c816b2db988 /usr/src/tools/smatch | |
| parent | 6f885041f36170b4a41586a5d1c649f478e3f8ad (diff) | |
| parent | 44bf619d328827ce5eca6833fcd5c69f1592e578 (diff) | |
| download | illumos-joyent-2eeb06d4319586a0633839bcb1704f78fd2b1977.tar.gz | |
[illumos-gate merge]
commit 44bf619d328827ce5eca6833fcd5c69f1592e578
10703 smatch unreachable code checking needs reworking
Diffstat (limited to 'usr/src/tools/smatch')
| -rw-r--r-- | usr/src/tools/smatch/Makefile | 6 | ||||
| -rw-r--r-- | usr/src/tools/smatch/src/Makefile | 2 | ||||
| -rw-r--r-- | usr/src/tools/smatch/src/check_unreachable.c | 2 | ||||
| -rw-r--r-- | usr/src/tools/smatch/src/parse.c | 1 | ||||
| -rw-r--r-- | usr/src/tools/smatch/src/smatch_data/illumos_kernel.no_return_funcs | 18 | ||||
| -rw-r--r-- | usr/src/tools/smatch/src/smatch_data/illumos_user.no_return_funcs | 21 |
6 files changed, 5 insertions, 45 deletions
diff --git a/usr/src/tools/smatch/Makefile b/usr/src/tools/smatch/Makefile index bd0bce00b2..37cc2fdf51 100644 --- a/usr/src/tools/smatch/Makefile +++ b/usr/src/tools/smatch/Makefile @@ -13,14 +13,14 @@ # # The src/ sub-directory is un-modified copy of -# https://github.com/illumos/smatch/tree/0.5.1-il-4 +# https://github.com/illumos/smatch/tree/0.5.1-il-5 # # This Makefile installs just enough for us to be able to run smatch # locally. # PROG = smatch -SPARSE_VERSION = 0.5.1-il-4 +SPARSE_VERSION = 0.5.1-il-5 include ../Makefile.tools @@ -101,9 +101,7 @@ OBJS += target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \ macro_table.o token_store.o hashtable.o SMATCH_DATA = \ - illumos_kernel.no_return_funcs \ illumos_kernel.skipped_functions \ - illumos_user.no_return_funcs \ illumos_user.skipped_functions SMATCH_DB_DATA = \ diff --git a/usr/src/tools/smatch/src/Makefile b/usr/src/tools/smatch/src/Makefile index c1423afbbf..388f5900a1 100644 --- a/usr/src/tools/smatch/src/Makefile +++ b/usr/src/tools/smatch/src/Makefile @@ -1,4 +1,4 @@ -VERSION=0.5.1-il-4 +VERSION=0.5.1-il-5 # Generating file version.h if current version has changed SPARSE_VERSION:=$(shell git describe 2>/dev/null || echo '$(VERSION)') diff --git a/usr/src/tools/smatch/src/check_unreachable.c b/usr/src/tools/smatch/src/check_unreachable.c index 9762ddcfa0..3c0fab0344 100644 --- a/usr/src/tools/smatch/src/check_unreachable.c +++ b/usr/src/tools/smatch/src/check_unreachable.c @@ -172,7 +172,7 @@ static void unreachable_stmt(struct statement *stmt) default: break; } - sm_msg("info: ignoring unreachable code."); + sm_warning("ignoring unreachable code."); print_unreached = 0; } diff --git a/usr/src/tools/smatch/src/parse.c b/usr/src/tools/smatch/src/parse.c index ca4726b80a..44c5970732 100644 --- a/usr/src/tools/smatch/src/parse.c +++ b/usr/src/tools/smatch/src/parse.c @@ -2859,6 +2859,7 @@ struct token *external_declaration(struct token *token, struct symbol_list **lis /* Parse declaration-specifiers, if any */ token = declaration_specifiers(token, &ctx); mod = storage_modifiers(&ctx); + mod |= ctx.ctype.modifiers & MOD_NORETURN; decl = alloc_symbol(token->pos, SYM_NODE); /* Just a type declaration? */ if (match_op(token, ';')) { diff --git a/usr/src/tools/smatch/src/smatch_data/illumos_kernel.no_return_funcs b/usr/src/tools/smatch/src/smatch_data/illumos_kernel.no_return_funcs deleted file mode 100644 index e5e288851d..0000000000 --- a/usr/src/tools/smatch/src/smatch_data/illumos_kernel.no_return_funcs +++ /dev/null @@ -1,18 +0,0 @@ -/* - * These functions don't return. Unfortunately, sparse today doesn't correctly - * respect __NORETURN, so we have to explicitly list them here for now. - */ -__assert_fail -__builtin_unreachable -bop_panic -efi_reset -panic -pc_reset -prom_exit_to_mon -prom_panic -prom_reboot -reset -resume_from_zombie -swtch_from_zombie -thread_exit -vpanic diff --git a/usr/src/tools/smatch/src/smatch_data/illumos_user.no_return_funcs b/usr/src/tools/smatch/src/smatch_data/illumos_user.no_return_funcs deleted file mode 100644 index 730326547b..0000000000 --- a/usr/src/tools/smatch/src/smatch_data/illumos_user.no_return_funcs +++ /dev/null @@ -1,21 +0,0 @@ -/* - * These functions don't return. Unfortunately, sparse today doesn't correctly - * respect __NORETURN, so we have to explicitly list them here for now. - */ -__assert_fail -__builtin_unreachable -abort -ctfmerge_fatal -err -errx -_exit -exit -_longjmp -longjmp -pthread_exit -reparsed_door_call_error -siglongjmp -terminate -thr_exit -verr -verrx |
