* [kvm-unit-tests PATCH] Include util.h to check the prototype with the implementation
@ 2017-06-27 5:18 Thomas Huth
2017-06-27 8:40 ` David Hildenbrand
2017-06-27 12:30 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2017-06-27 5:18 UTC (permalink / raw)
To: kvm; +Cc: Paolo Bonzini, Radim Krčmář
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".
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
lib/util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/util.c b/lib/util.c
index 69b1810..a905541 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -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)
{
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [kvm-unit-tests PATCH] Include util.h to check the prototype with the implementation
2017-06-27 5:18 [kvm-unit-tests PATCH] Include util.h to check the prototype with the implementation Thomas Huth
@ 2017-06-27 8:40 ` David Hildenbrand
2017-06-27 12:30 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2017-06-27 8:40 UTC (permalink / raw)
To: Thomas Huth, kvm; +Cc: Paolo Bonzini, Radim Krčmář
On 27.06.2017 07:18, Thomas Huth wrote:
> 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".
Why is something like that not contained in -Wextra? ;)
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> lib/util.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/util.c b/lib/util.c
> index 69b1810..a905541 100644
> --- a/lib/util.c
> +++ b/lib/util.c
> @@ -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)
> {
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [kvm-unit-tests PATCH] Include util.h to check the prototype with the implementation
2017-06-27 5:18 [kvm-unit-tests PATCH] Include util.h to check the prototype with the implementation Thomas Huth
2017-06-27 8:40 ` David Hildenbrand
@ 2017-06-27 12:30 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-06-27 12:30 UTC (permalink / raw)
To: Thomas Huth, kvm; +Cc: Radim Krčmář
On 27/06/2017 07:18, Thomas Huth wrote:
> 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".
I think all of lib/ should compile with "-Wmissing-prototypes". I
applied this patch.
Paolo
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> lib/util.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/util.c b/lib/util.c
> index 69b1810..a905541 100644
> --- a/lib/util.c
> +++ b/lib/util.c
> @@ -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)
> {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-27 12:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-27 5:18 [kvm-unit-tests PATCH] Include util.h to check the prototype with the implementation Thomas Huth
2017-06-27 8:40 ` David Hildenbrand
2017-06-27 12:30 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox