From 145e16008e7479ea58278e55f71d6dfcd4db714b Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Fri, 18 Jun 2021 19:51:45 +0200 Subject: [PATCH 1/3] backend/microtek: fix uclibc compile (include stdarg.h for va_list/va_start/va_end) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: microtek.c: In function ‘MDBG_INIT’: microtek.c:163:3: error: unknown type name ‘va_list’ 163 | va_list ap; | ^~~~~~~ microtek.c:78:1: note: ‘va_list’ is defined in header ‘’; did you forget to ‘#include ’? 77 | #include "microtek.h" +++ |+#include 78 | microtek.c:164:3: warning: implicit declaration of function ‘va_start’; did you mean ‘sane_start’? [-Wimplicit-function-declaration] 164 | va_start(ap, format); | ^~~~~~~~ | sane_start microtek.c:165:54: warning: passing argument 4 of ‘vsnprintf’ makes pointer from integer without a cast [-Wint-conversion] 165 | vsnprintf(_mdebug_string, MAX_MDBG_LENGTH, format, ap); | ^~ | | | int In file included from ../include/sane/sanei_config.h:50, from microtek.c:70: .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:359:57: note: expected ‘__va_list_tag *’ but argument is of type ‘int’ 359 | const char *__restrict __format, __gnuc_va_list __arg) | ~~~~~~~~~~~~~~~^~~~~ microtek.c:166:3: warning: implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration] 166 | va_end(ap); | ^~~~~~ Signed-off-by: Peter Seiderer --- backend/microtek.c | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/microtek.c b/backend/microtek.c index 200a69c1a..63560179c 100644 --- a/backend/microtek.c +++ b/backend/microtek.c @@ -57,6 +57,7 @@ #include "../include/sane/config.h" +#include #include #include #include From 7dafc52dda96fa68f39058b10eec3d822fd5ea9d Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Fri, 18 Jun 2021 19:56:56 +0200 Subject: [PATCH 2/3] backend/sm3600-scanutil: fix uclibc compile (include stdarg.h for va_list/va_start/va_end) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: sm3600-scanutil.c: In function ‘debug_printf’: sm3600-scanutil.c:69:3: error: unknown type name ‘va_list’ 69 | va_list ap; | ^~~~~~~ sm3600-scanutil.c:48:1: note: ‘va_list’ is defined in header ‘’; did you forget to ‘#include ’? 47 | #include "sm3600-scantool.h" +++ |+#include 48 | sm3600-scanutil.c:75:3: warning: implicit declaration of function ‘va_start’; did you mean ‘sane_start’? [-Wimplicit-function-declaration] 75 | va_start(ap,szFormat); | ^~~~~~~~ | sane_start sm3600-scanutil.c:76:28: warning: passing argument 3 of ‘vfprintf’ makes pointer from integer without a cast [-Wint-conversion] 76 | vfprintf(stderr,szFormat,ap); | ^~ | | | int In file included from ../include/sane/sanei_config.h:50, from sm3600.c:70: .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:339:23: note: expected ‘__va_list_tag *’ but argument is of type ‘int’ 339 | __gnuc_va_list __arg); | ~~~~~~~~~~~~~~~^~~~~ In file included from sm3600.c:94: sm3600-scanutil.c:77:3: warning: implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration] 77 | va_end(ap); | ^~~~~~ Signed-off-by: Peter Seiderer --- backend/sm3600-scanutil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/sm3600-scanutil.c b/backend/sm3600-scanutil.c index 6fe67ed0c..616bf3f4c 100644 --- a/backend/sm3600-scanutil.c +++ b/backend/sm3600-scanutil.c @@ -43,6 +43,7 @@ Userspace scan tool for the Microtek 3600 scanner ====================================================================== */ +#include #include #include "sm3600-scantool.h" From b1021e09e435e6c727303b9bfa2f69eb8fcf958a Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Fri, 18 Jun 2021 20:10:02 +0200 Subject: [PATCH 3/3] backend/pixma: fix compile with NDEBUG Fixes: .../host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/9.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: ./.libs/libpixma.a(libpixma_la-pixma_common.o): in function `sanei_pixma_read_image': pixma_common.c:(.text+0xc05): undefined reference to `DBG' .../host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/9.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: pixma_common.c:(.text+0xc38): undefined reference to `DBG' .../host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/9.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: pixma_common.c:(.text+0xcbf): undefined reference to `DBG' Signed-off-by: Peter Seiderer --- backend/pixma/pixma_common.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/pixma/pixma_common.c b/backend/pixma/pixma_common.c index 6bce4bce9..24912b863 100644 --- a/backend/pixma/pixma_common.c +++ b/backend/pixma/pixma_common.c @@ -968,16 +968,16 @@ pixma_read_image (pixma_t * s, void *buf, unsigned len) s->last_source = s->param->source; if ((s->cur_image_size != s->param->image_size) && !s->param->mode_jpeg) { - pixma_dbg (1, "WARNING:image size mismatches\n"); - pixma_dbg (1, + PDBG (pixma_dbg (1, "WARNING:image size mismatches\n")); + PDBG (pixma_dbg (1, " %"PRIu64" expected (%d lines) but %"PRIu64" received (%"PRIu64" lines)\n", s->param->image_size, s->param->h, s->cur_image_size, - s->cur_image_size / s->param->line_size); + s->cur_image_size / s->param->line_size)); if ((s->cur_image_size % s->param->line_size) != 0) { - pixma_dbg (1, - "BUG:received data not multiple of line_size\n"); + PDBG (pixma_dbg (1, + "BUG:received data not multiple of line_size\n")); } } if ((s->cur_image_size < s->param->image_size) && !s->param->mode_jpeg)