Skip to contentSkip to conversation

package/sane-backends: fix uclibc compile (missing stdarg.h include for va_list/va_start/va_end)

PATCH In review Peter Seiderer 4 participants 5 messages Jun 18, 2021 – Aug 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/sane-backends: fix uclibc compile (missing stdarg.h include for va_list/va_start/va_end)

Add missing stdarg.h include for va_list/va_start/va_end.

Fixes:

- http://autobuild.buildroot.net/results/88f4ea971875b1a5eb88662326d9343341eaaea2

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 ?<stdarg.h>?; did you forget to ?#include <stdarg.h>??
     77 | #include "microtek.h"
    +++ |+#include <stdarg.h>
     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);
        |   ^~~~~~

and

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 ?<stdarg.h>?; did you forget to ?#include <stdarg.h>??
     47 | #include "sm3600-scantool.h"
    +++ |+#include <stdarg.h>
     48 |
  sm3600-scanutil.c:75:3: warning: implicit declaration of function ?va_start?; did you mean ?sane_start?? [-Wimplicit-function-decla
ration]
     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);
        |   ^~~~~~
---
 ...-fix-uclibc-compile-include-stdarg.h.patch | 58 ++++++++++++++++++
 ...canutil-fix-uclibc-compile-include-s.patch | 59 +++++++++++++++++++
 2 files changed, 117 insertions(+)
 create mode 100644 package/sane-backends/0004-backend-microtek-fix-uclibc-compile-include-stdarg.h.patch
 create mode 100644 package/sane-backends/0005-backend-sm3600-scanutil-fix-uclibc-compile-include-s.patch
package/sane-backends/0004-backend-microtek-fix-uclibc-compile-include-stdarg.h.patch new file +58 -0
new file mode 100644
index 0000000000..c5af162469
@@ -0,0 +1,58 @@
+From 145e16008e7479ea58278e55f71d6dfcd4db714b Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Fri, 18 Jun 2021 19:51:45 +0200
+Subject: [PATCH] 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 ?<stdarg.h>?; did you forget to ?#include <stdarg.h>??
+     77 | #include "microtek.h"
+    +++ |+#include <stdarg.h>
+     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);
+        |   ^~~~~~
+
+[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/638]
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ 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 <stdarg.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+-- 
+2.31.1
+
package/sane-backends/0005-backend-sm3600-scanutil-fix-uclibc-compile-include-s.patch new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
2.31.1
#1 lore raw

PATCH 2/2 package/sane-backends: fix NDEBUG compile (missing PDBG before pixma_dbg)

Add patch to add missing PDBG before pixma_dbg.

Fixes:

- http://autobuild.buildroot.net/results/88f4ea971875b1a5eb88662326d9343341eaaea2

.../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'

---
 ...ackend-pixma-fix-compile-with-NDEBUG.patch | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 package/sane-backends/0006-backend-pixma-fix-compile-with-NDEBUG.patch
package/sane-backends/0006-backend-pixma-fix-compile-with-NDEBUG.patch new file +47 -0
new file mode 100644
index 0000000000..2213cdb9b5
@@ -0,0 +1,47 @@
+From b1021e09e435e6c727303b9bfa2f69eb8fcf958a Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Fri, 18 Jun 2021 20:10:02 +0200
+Subject: [PATCH] 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'
+
+[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/638]
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ 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)
+-- 
+2.31.1
+
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/2 package/sane-backends: fix NDEBUG compile (missing PDBG before pixma_dbg)

Peter, All,

On 2021-06-18 20:31 +0200, Peter Seiderer spake thusly:

Quoted 4 lines

Add patch to add missing PDBG before pixma_dbg.

Fixes:

Quoted 8 lines

- http://autobuild.buildroot.net/results/88f4ea971875b1a5eb88662326d9343341eaaea2

.../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'

We are now no longer setting NDEBUG in the infra; see a1c7cff1a081.

So this patch is no longer needed; I've marked it as rejected (but we will get it next time we update sane-backends).

Thanks!

Regards,
Yann E. MORIN.

Quoted 65 lines
---
 ...ackend-pixma-fix-compile-with-NDEBUG.patch | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 package/sane-backends/0006-backend-pixma-fix-compile-with-NDEBUG.patch
package/sane-backends/0006-backend-pixma-fix-compile-with-NDEBUG.patch new file +47 -0
new file mode 100644
index 0000000000..2213cdb9b5
@@ -0,0 +1,47 @@
+From b1021e09e435e6c727303b9bfa2f69eb8fcf958a Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Fri, 18 Jun 2021 20:10:02 +0200
+Subject: [PATCH] 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'
+
+[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/638]
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ 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)
+-- 
+2.31.1
+
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/2 package/sane-backends: fix uclibc compile (missing stdarg.h include for va_list/va_start/va_end)

In reply to Peter Seiderer
Quoted 63 lines · On Fri, 18 Jun 2021 20:31:49 +0200 Peter Seiderer <[email protected]> wrote:

Add missing stdarg.h include for va_list/va_start/va_end.

Fixes:

- http://autobuild.buildroot.net/results/88f4ea971875b1a5eb88662326d9343341eaaea2

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 ?<stdarg.h>?; did you forget to ?#include <stdarg.h>??
     77 | #include "microtek.h"
    +++ |+#include <stdarg.h>
     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);
        |   ^~~~~~

and

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 ?<stdarg.h>?; did you forget to ?#include <stdarg.h>??
     47 | #include "sm3600-scantool.h"
    +++ |+#include <stdarg.h>
     48 |
  sm3600-scanutil.c:75:3: warning: implicit declaration of function ?va_start?; did you mean ?sane_start?? [-Wimplicit-function-decla
ration]
     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);
        |   ^~~~~~
Quoted 7 lines
---
 ...-fix-uclibc-compile-include-stdarg.h.patch | 58 ++++++++++++++++++
 ...canutil-fix-uclibc-compile-include-s.patch | 59 +++++++++++++++++++
 2 files changed, 117 insertions(+)
 create mode 100644 package/sane-backends/0004-backend-microtek-fix-uclibc-compile-include-stdarg.h.patch
 create mode 100644 package/sane-backends/0005-backend-sm3600-scanutil-fix-uclibc-compile-include-s.patch

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw
In reply to Peter Seiderer
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Seiderer <[email protected]> writes:

Add missing stdarg.h include for va_list/va_start/va_end. Fixes:

- http://autobuild.buildroot.net/results/88f4ea971875b1a5eb88662326d9343341eaaea2

Committed to 2021.05.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot