Include util.h to check the prototype with the implementation
Subsystems (2)
PATCH 1/1 Include util.h to check the prototype with the implementation
util.c should include util.h so that the compiler can check that the prototype from the header matches the implementation. This is required for compiling the file with "-Wmissing-prototypes".
--- lib/util.c | 1 + 1 file changed, 1 insertion(+)
lib/util.c +1 -0
@@ -4,6 +4,7 @@* This work is licensed under the terms of the GNU LGPL, version 2. */ #include <libcflat.h> +#include "util.h" int parse_keyval (char *s,long *val) {
Signature · 1 line
1.8.3.1
Quoted 3 lines · Thomas Huth
util.cshould includeutil.hso that the compiler can check that the prototype from the header matches the implementation. This is required for compiling the file with "-Wmissing-prototypes".
Why is something like that not contained in -Wextra? ;)
Quoted 12 lines
Signed-off-by Thomas Huth <[email protected]>--- lib/util.c | 1 + 1 file changed, 1 insertion(+)lib/util.c +0
-0
lib/util.c line 10
Quoted 7 lines
lib/util.c +1
-0@@ -4,6 +4,7 @@* This work is licensed under the terms of the GNU LGPL, version 2. */ #include <libcflat.h> +#include "util.h" int parse_keyval (char *s,long *val) {
Signature · 3 lines
Thanks, David
Paolo Bonzini
maintainerQuoted 3 lines · Thomas Huth
util.cshould includeutil.hso that the compiler can check that the prototype from the header matches the implementation. This is required for compiling the file with "-Wmissing-prototypes".
I think all of lib/ should compile with "-Wmissing-prototypes". I applied this patch.
Paolo
Quoted 18 lines
Signed-off-by Thomas Huth <[email protected]>--- lib/util.c | 1 + 1 file changed, 1 insertion(+)lib/util.c +1
-0@@ -4,6 +4,7 @@* This work is licensed under the terms of the GNU LGPL, version 2. */ #include <libcflat.h> +#include "util.h" int parse_keyval (char *s,long *val) {