diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-02-13 00:28:53 +0100 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2017-02-13 09:38:08 +0800 |
| commit | f934189b99ee083af9dc5f6dd21652ec4440deaf (patch) | |
| tree | 0a3e8241732f385965587da3b1345608761d39dd /validation | |
| parent | cac6d8d34ba6f1617b69134bf7528f4a9768097b (diff) | |
| download | sparse-dev-f934189b99ee083af9dc5f6dd21652ec4440deaf.tar.gz | |
testsuite: simplify the ioc-typecheck case
The test was relatively convoluted and it wasn't very clear what
was the problem and waht was tested.
The real problem is simply a problem about a non-constant
expression in an array designator.
Simplify the test to clearly show that.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/ioc-typecheck.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/validation/ioc-typecheck.c b/validation/ioc-typecheck.c index aa060f7b..34b37d31 100644 --- a/validation/ioc-typecheck.c +++ b/validation/ioc-typecheck.c @@ -1,16 +1,10 @@ extern unsigned int __invalid_size_argument_for_IOC; -#define _IOC_TYPECHECK(t) \ - ((sizeof(t) == sizeof(t[1]) && \ - sizeof(t) < (1 << 14)) ? \ - sizeof(t) : __invalid_size_argument_for_IOC) - -#define TEST_IOCTL (50 | (_IOC_TYPECHECK(unsigned) << 8)) - static unsigned iocnrs[] = { - [TEST_IOCTL & 0xff] = 1, + [ 1 ? 0 : __invalid_size_argument_for_IOC ] = 1, }; /* - * check-name: correct handling of _IOC_TYPECHECK + * check-name: integer constant & conditional expression + * check-known-to-fail * * check-error-start * check-error-end |
