diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-09 22:53:00 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-09 23:16:57 +0200 |
commit | 72c88ef852d6ad53564e2e284e7fa239cef5ba8f (patch) | |
tree | 53a50544e0f5be531c45e307691320917fd007cb | |
parent | c9676a3b0349a1053c673243af52a2ef1b272bd7 (diff) | |
download | sparse-72c88ef852d6ad53564e2e284e7fa239cef5ba8f.tar.gz |
add a testcase for assignment to const <type> (*)[]
You can assign a '<type>[]' to a 'const <type> *'. Likewise,
you can assign a '<type>[][N]' to a 'const <type> (*)[N]' but
sparse doesn't like this.
Analyzed-by: Ard Biesheuvel <ardb@kernel.org>
Reported-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://lore.kernel.org/linux-crypto/20200709120937.GA13332@gondor.apana.org.au/
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | validation/eval/array-quals0.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/validation/eval/array-quals0.c b/validation/eval/array-quals0.c new file mode 100644 index 00000000..9cb08c17 --- /dev/null +++ b/validation/eval/array-quals0.c @@ -0,0 +1,7 @@ +static int a[2][3]; +static const int (*p)[3] = a; + +/* + * check-name: array-quals0 + * check-known-to-fail + */ |