diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2022-05-21 11:16:24 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2022-05-21 11:18:40 +0200 |
| commit | 7d990b119a6249af9a1ef4f3df9957d8975b56b2 (patch) | |
| tree | fd21e6b95ea88839593466e8c6f4db304f942824 /validation/label-positioning.c | |
| parent | c4706aa764f3ae68258ba60be6325a5662900362 (diff) | |
| parent | d08822184fe1d4557beca97c2e3599ffc3668e50 (diff) | |
| download | sparse-dev-7d990b119a6249af9a1ef4f3df9957d8975b56b2.tar.gz | |
Merge branch 'next-ramsay'
* fix regression disabling the 'memcpy-max-count' check.
* warn about a 'case label' on empty statement
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/label-positioning.c')
| -rw-r--r-- | validation/label-positioning.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/validation/label-positioning.c b/validation/label-positioning.c new file mode 100644 index 00000000..583661ca --- /dev/null +++ b/validation/label-positioning.c @@ -0,0 +1,22 @@ +extern int someval(void); + +static void func (int x) +{ + if (x > someval()) + goto end; + switch (x) { case 0: } + switch (x) { case 1 ... 9: } + switch (x) { default: } +end: +} + +/* + * check-name: label-positioning + * + * check-error-start +label-positioning.c:7:30: warning: statement expected after case label +label-positioning.c:8:36: warning: statement expected after case label +label-positioning.c:9:31: warning: statement expected after case label +label-positioning.c:11:1: warning: statement expected after label + * check-error-end + */ |
