1From 7dafc52dda96fa68f39058b10eec3d822fd5ea9d Mon Sep 17 00:00:00 2001
2From: Peter Seiderer <ps.report@gmx.net>
3Date: Fri, 18 Jun 2021 19:56:56 +0200
4Subject: [PATCH] backend/sm3600-scanutil: fix uclibc compile (include stdarg.h
5 for va_list/va_start/va_end)
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Fixes:
11
12  sm3600-scanutil.c: In function ‘debug_printf’:
13  sm3600-scanutil.c:69:3: error: unknown type name ‘va_list’
14     69 |   va_list ap;
15        |   ^~~~~~~
16  sm3600-scanutil.c:48:1: note: ‘va_list’ is defined in header ‘<stdarg.h>’; did you forget to ‘#include <stdarg.h>’?
17     47 | #include "sm3600-scantool.h"
18    +++ |+#include <stdarg.h>
19     48 |
20  sm3600-scanutil.c:75:3: warning: implicit declaration of function ‘va_start’; did you mean ‘sane_start’? [-Wimplicit-function-declaration]
21     75 |   va_start(ap,szFormat);
22        |   ^~~~~~~~
23        |   sane_start
24  sm3600-scanutil.c:76:28: warning: passing argument 3 of ‘vfprintf’ makes pointer from integer without a cast [-Wint-conversion]
25     76 |   vfprintf(stderr,szFormat,ap);
26        |                            ^~
27        |                            |
28        |                            int
29  In file included from ../include/sane/sanei_config.h:50,
30                   from sm3600.c:70:
31  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:339:23: note: expected ‘__va_list_tag *’ but argument is of type ‘int’
32    339 |        __gnuc_va_list __arg);
33        |        ~~~~~~~~~~~~~~~^~~~~
34  In file included from sm3600.c:94:
35  sm3600-scanutil.c:77:3: warning: implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration]
36     77 |   va_end(ap);
37        |   ^~~~~~
38
39[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/638]
40Signed-off-by: Peter Seiderer <ps.report@gmx.net>
41---
42 backend/sm3600-scanutil.c | 1 +
43 1 file changed, 1 insertion(+)
44
45diff --git a/backend/sm3600-scanutil.c b/backend/sm3600-scanutil.c
46index 6fe67ed0c..616bf3f4c 100644
47--- a/backend/sm3600-scanutil.c
48+++ b/backend/sm3600-scanutil.c
49@@ -43,6 +43,7 @@ Userspace scan tool for the Microtek 3600 scanner
50
51 ====================================================================== */
52
53+#include <stdarg.h>
54 #include <unistd.h>
55 #include "sm3600-scantool.h"
56
57--
582.31.1
59
60