diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-21 18:28:38 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-21 18:28:38 +0200 |
| commit | f0fe1cd9e4fe2e937f452561b62c4ab9d0989ece (patch) | |
| tree | 66ffdd8d46612d2ed98149b19f090ff53c5d4aed /validation | |
| parent | 4d96f72782e076f7c4410394364aa77336c09bd2 (diff) | |
| parent | 537e3e2daebd37d69447e65535fc94e82b38fc18 (diff) | |
| download | sparse-dev-f0fe1cd9e4fe2e937f452561b62c4ab9d0989ece.tar.gz | |
Merge branch 'univ'
* conditionally accept { 0 } without warnings
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/Wuniv-init-ko.c | 14 | ||||
| -rw-r--r-- | validation/Wuniv-init-ok.c | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/validation/Wuniv-init-ko.c b/validation/Wuniv-init-ko.c new file mode 100644 index 00000000..315c211a --- /dev/null +++ b/validation/Wuniv-init-ko.c @@ -0,0 +1,14 @@ +struct s { + void *ptr; +}; + + +static struct s s = { 0 }; + +/* + * check-name: univ-init-ko + * + * check-error-start +Wuniv-init-ko.c:6:23: warning: Using plain integer as NULL pointer + * check-error-end + */ diff --git a/validation/Wuniv-init-ok.c b/validation/Wuniv-init-ok.c new file mode 100644 index 00000000..c3964751 --- /dev/null +++ b/validation/Wuniv-init-ok.c @@ -0,0 +1,11 @@ +struct s { + void *ptr; +}; + + +static struct s s = { 0 }; + +/* + * check-name: univ-init-ok + * check-command: sparse -Wno-universal-initializer $file + */ |
