diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-11-30 22:51:24 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-12-01 02:14:10 +0100 |
| commit | eb35b2e8aa79552fe0ccd7a4e7a7753b230cbdd4 (patch) | |
| tree | e8377e3916984fc17e9452dfab6c9537c03e603d /validation | |
| parent | 6f7aa5e84dacec8e27a8d70090bba26a1a1276de (diff) | |
| download | sparse-dev-eb35b2e8aa79552fe0ccd7a4e7a7753b230cbdd4.tar.gz | |
Use -Wimplicit-int when warning about missing K&R argument types
In legacy environment, a lot of warnings can be issued about
arguments without an explicit type.
Fix this by contitionalizing such warnings with the flag
-Wimplicit-int, reducing the level of noise in such environment.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/implicit-KR-arg-type0.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/validation/implicit-KR-arg-type0.c b/validation/implicit-KR-arg-type0.c new file mode 100644 index 00000000..f73d36ff --- /dev/null +++ b/validation/implicit-KR-arg-type0.c @@ -0,0 +1,15 @@ +int foo(a, b) + int a; +{ + if (b) + return a; +} + +/* + * check-name: implicit-KR-arg-type + * check-command: sparse -Wno-decl -Wold-style-definition -Wno-implicit-int $file + * + * check-error-start +implicit-KR-arg-type0.c:2:9: warning: non-ANSI definition of function 'foo' + * check-error-end + */ |
