diff mbox series

[RESEND,v1,1/8] stubdom/vtpm: include stdio.h for declaration of printf

Message ID 20190924140319.11303-2-olaf@aepfle.de (mailing list archive)
State Superseded
Headers show
Series tools, doc and stubdom fixes | expand

Commit Message

Olaf Hering Sept. 24, 2019, 2:03 p.m. UTC
The function read_vtpmblk uses printf(3), but stdio.h is not included
in this file. This results in a warning from gcc-7:

vtpmblk.c: In function 'read_vtpmblk':
vtpmblk.c:322:7: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
       printf("Expected: ");
vtpmblk.c:322:7: warning: incompatible implicit declaration of built-in function 'printf'
vtpmblk.c:322:7: note: include '<stdio.h>' or provide a declaration of 'printf'

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 stubdom/vtpm/vtpmblk.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel De Graaf Sept. 27, 2019, 9:27 p.m. UTC | #1
On 9/24/19 10:03 AM, Olaf Hering wrote:
> The function read_vtpmblk uses printf(3), but stdio.h is not included
> in this file. This results in a warning from gcc-7:
> 
> vtpmblk.c: In function 'read_vtpmblk':
> vtpmblk.c:322:7: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
>         printf("Expected: ");
> vtpmblk.c:322:7: warning: incompatible implicit declaration of built-in function 'printf'
> vtpmblk.c:322:7: note: include '<stdio.h>' or provide a declaration of 'printf'
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
diff mbox series

Patch

diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
index fe529ab5ac..681f0c01b6 100644
--- a/stubdom/vtpm/vtpmblk.c
+++ b/stubdom/vtpm/vtpmblk.c
@@ -20,6 +20,7 @@ 
 #include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <stdio.h>
 
 /*Encryption key and block sizes */
 #define BLKSZ 16