]> git.ozlabs.org Git - ppp.git/commitdiff
pppd/crypto: Fix gcc 14 build (#524)
authornasbdh9 <nabsdh9@gmail.com>
Tue, 15 Oct 2024 02:53:48 +0000 (10:53 +0800)
committerGitHub <noreply@github.com>
Tue, 15 Oct 2024 02:53:48 +0000 (13:53 +1100)
Fix this:

crypto.c: In function 'PPP_crypto_error':
crypto.c:178:11: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration]
  178 |     off = vsnprintf(buf, len, fmt, args);
      |           ^~~~~~~~~
crypto.c:41:1: note: include '<stdio.h>' or provide a declaration of 'vsnprintf'
   40 | #include "crypto-priv.h"
  +++ |+#include <stdio.h>
   41 |
crypto.c:178:26: warning: 'vsnprintf' argument 2 type is 'int' where 'long unsigned int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
  178 |     off = vsnprintf(buf, len, fmt, args);
      |                          ^~~
<built-in>: note: built-in 'vsnprintf' declared here

Signed-off-by: Tan Zien <nabsdh9@gmail.com>
pppd/crypto.c

index 054ee1364e74e84b0637d26a2607e24569bbb509..3576afd5ac7239556806ff8e1b48c0fa4b146acf 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <stdio.h>
 
 #include "pppd.h"
 #include "crypto.h"
@@ -243,7 +244,6 @@ int PPP_crypto_deinit()
 }
 
 #ifdef UNIT_TEST
-#include <stdio.h>
 
 int debug;
 int error_count;