From 6d4506fa201989698f643ec3a50b2b6201d829fe Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Tue, 16 Jun 2020 20:23:54 +0200 Subject: doc: update TODO Support for __builtin_unreachable() was added in commit d2be323e25c3 ("teach sparse to linearize __builtin_unreachable()") So, remove this item from the TODO list. Signed-off-by: Luc Van Oostenryck --- Documentation/TODO.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/TODO.md b/Documentation/TODO.md index 4344a1dc..64c1523c 100644 --- a/Documentation/TODO.md +++ b/Documentation/TODO.md @@ -34,7 +34,6 @@ Misc ---- * GCC's -Wenum-compare / clangs's -Wenum-conversion -Wassign-enum * parse __attribute_((fallthrough)) -* add support for __builtin_unreachable() * add support for format(printf()) (WIP by Ben Dooks) * make use of UNDEFs (issues warnings, simplification, ... ?) * add a pass to inline small functions during simplification. -- cgit 1.2.3-korg From 2bf23b46328bf623cf3a2e5b1c3d4c1c9cd2fe6e Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Tue, 16 Jun 2020 20:24:56 +0200 Subject: doc: fix some typos Fix some silly typos. Signed-off-by: Luc Van Oostenryck --- Documentation/types.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/types.rst b/Documentation/types.rst index e5d07def..5c10725f 100644 --- a/Documentation/types.rst +++ b/Documentation/types.rst @@ -13,7 +13,7 @@ For the purpose of this document, things can be simplified into: struct ctype { struct symbol *base_type; unsigned long modifiers; - unsigned long alignement; + unsigned long alignment; struct context_list *contexts; struct indent *as; }; @@ -68,7 +68,7 @@ have their own modifiers, address_space, contexts or alignment as well as the declaration's identifier. Usage: - * .ctype.base_type points to the unmodified type (wich must not + * .ctype.base_type points to the unmodified type (which must not be a SYM_NODE itself) * .ctype.modifiers, .as, .alignment, .contexts will contains the 'variation' (MOD_CONST, the attributes, ...). -- cgit 1.2.3-korg From 1b31044203e662aaeb9f1e5b1d2e36a40016de27 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Tue, 16 Jun 2020 20:26:38 +0200 Subject: doc: fix markup in types.rst (s/```/``/) Literal text was marked with ``` but that's a bit excessive. Fix that by replacing these with ``. Signed-off-by: Luc Van Oostenryck --- Documentation/types.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Documentation/types.rst b/Documentation/types.rst index 5c10725f..272f32a0 100644 --- a/Documentation/types.rst +++ b/Documentation/types.rst @@ -30,16 +30,16 @@ Some bits, also related to the type, are in struct symbol itself: * accessed * transparent_union -* ```base_type``` is used for the associated base type. -* ```modifiers``` is a bit mask for type specifiers (MOD_UNSIGNED, ...), +* ``base_type`` is used for the associated base type. +* ``modifiers`` is a bit mask for type specifiers (MOD_UNSIGNED, ...), type qualifiers (MOD_CONST, MOD_VOLATILE), storage classes (MOD_STATIC, MOD_EXTERN, ...), as well for various attributes. It's also used internally to keep track of some states (MOD_ACCESS or MOD_ADDRESSABLE). -* ```alignment``` is used for the alignment, in bytes. -* ```contexts``` is used to store the informations associated with the - attribute ```context()```. -* ```as``` is used to hold the identifier of the attribute ```address_space()```. +* ``alignment`` is used for the alignment, in bytes. +* ``contexts`` is used to store the informations associated with the + attribute ``context()``. +* ``as`` is used to hold the identifier of the attribute ``address_space()``. Kind of types ============= @@ -49,11 +49,11 @@ SYM_BASETYPE Used by integer, floating-point, void, 'type', 'incomplete' & bad types. For integer types: - * .ctype.base_type points to ```int_ctype```, the generic/abstract integer type + * .ctype.base_type points to ``int_ctype``, the generic/abstract integer type * .ctype.modifiers has MOD_UNSIGNED/SIGNED/EXPLICITLY_SIGNED set accordingly. For floating-point types: - * .ctype.base_type points to ```fp_ctype```, the generic/abstract float type + * .ctype.base_type points to ``fp_ctype``, the generic/abstract float type * .ctype.modifiers is zero. For the other base types: @@ -131,7 +131,7 @@ Used for bitwise types (aka 'restricted' types): SYM_FOULED ---------- Used for bitwise types when the negation op (~) is -used and the bit_size is smaller than an ```int```. +used and the bit_size is smaller than an ``int``. There is a 1-to-1 mapping between a fouled type and its parent bitwise type. -- cgit 1.2.3-korg From bf1408ac0d6131ea4a61785d2de27bfd091e26c8 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Tue, 16 Jun 2020 20:30:53 +0200 Subject: doc: reformulate an item in the TODO One of the item wasn't even grammatical. Reformulate it. Signed-off-by: Luc Van Oostenryck --- Documentation/TODO.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/TODO.md b/Documentation/TODO.md index 64c1523c..e2043e48 100644 --- a/Documentation/TODO.md +++ b/Documentation/TODO.md @@ -84,8 +84,8 @@ Longer term/to investigate "warning: Variable length array is used. (-Wno-vla)" -* ptrlists must have elements be removed while being iterated but this - is hard to insure it is not done. +* ptrlists must not have elements removed while being iterated; + this should somehow be enforced. * having 'struct symbol' used to represent symbols *and* types is quite handy but it also creates lots of problems and complications * Possible mixup of symbol for a function designator being not a pointer? -- cgit 1.2.3-korg From cbd3735049526d55d79b7176019f4a0c02a41dca Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Tue, 16 Jun 2020 07:12:44 +0200 Subject: build: let the C++ compiler be configurable By default, the C compiler is 'gcc' but it can be overridden on the command line via 'make CC=...'. However, the C++ compiler (only needed for sparse-llvm) is hardcoded to 'g++'. Fix this by allowing to specify the C++ compiler via 'CXX=...' but keeping 'g++' as the default. Signed-off-by: Luc Van Oostenryck --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f46654e7..07de0bc3 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ OS = linux CC = gcc +CXX = g++ LD = $(CC) AR = ar @@ -189,7 +190,7 @@ LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version) LLVM_VERSION_MAJOR:=$(firstword $(subst ., ,$(LLVM_VERSION))) ifeq ($(shell expr "$(LLVM_VERSION_MAJOR)" '>=' 3),1) LLVM_PROGS := sparse-llvm -$(LLVM_PROGS): LD := g++ +$(LLVM_PROGS): LD := $(CXX) LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags) LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cppflags) LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs) -- cgit 1.2.3-korg From 9cd32cbde900238795ad80c5e3c0adb5975c8f2e Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Mon, 15 Jun 2020 01:39:44 +0200 Subject: testsuite: be less paranoid with timeout For some testcases, the testsuite use the command 'timeout' to ensure that the test finish after a reasonable amount of time. This is mainly used for some testcases which, in the past, were stuck in an infinite loop. This the command 'timeout' is used with an extra option (-k 1s) to issue a second kill signal in case the first one would have been ignored. However, this extra option is not supported on all implementations (Alpine) and its use seems a bit paranoid for sparse. So, remove this extra option. Signed-off-by: Luc Van Oostenryck --- validation/test-suite | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/test-suite b/validation/test-suite index 64a3e08f..a22f7013 100755 --- a/validation/test-suite +++ b/validation/test-suite @@ -338,7 +338,7 @@ do_test() # do we want a timeout? pre_cmd="" if [ $check_timeout -ne 0 ]; then - pre_cmd="timeout -k 1s $check_timeout" + pre_cmd="timeout $check_timeout" fi shift -- cgit 1.2.3-korg