diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-08 13:41:40 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-17 00:57:28 +0100 |
commit | e1ec9736ab7feeacb6829193bdc53b32248e3c3e (patch) | |
tree | 4beaf2fee5fa8dd813166b2dfcd539c2621dcb7a | |
parent | 82dee2e25887f26df7126d6789a419eaf14beb8c (diff) | |
download | sparse-e1ec9736ab7feeacb6829193bdc53b32248e3c3e.tar.gz |
fix testcase with non-constant initializer
These 2 top-level declarations had a non-constant initializer.
Fix that by moving them into a function.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | validation/nocast.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/validation/nocast.c b/validation/nocast.c index 6c5da968..2113227c 100644 --- a/validation/nocast.c +++ b/validation/nocast.c @@ -26,8 +26,8 @@ static ulong_nc_t good_deref(ulong_nc_t *t) /* assign value */ static ulong_nc_t t; -static ulong_nc_t good_assign_self = t; -static unsigned long good_assign_sametype = t; + + /* assign pointer */ static ulong_nc_t *good_ptr = &t; @@ -150,6 +150,12 @@ static unsigned long bad_fromcast(ulong_nc_t v) return (unsigned long) v; } +static void assign_value(void) +{ + ulong_nc_t good_assign_self = t; + unsigned long good_assign_sametype = t; +} + /* * check-name: nocast.c * |