This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/9 v2] Introduce nat/linux-namespaces.[ch]
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Gary Benson <gbenson at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Eli Zaretskii <eliz at gnu dot org>, Doug Evans <dje at google dot com>, Iago López Galeiras <iago at endocode dot com>
- Date: Thu, 11 Jun 2015 09:40:24 +0100
- Subject: Re: [PATCH 2/9 v2] Introduce nat/linux-namespaces.[ch]
- Authentication-results: sourceware.org; auth=none
- References: <555DF224 dot 8020101 at redhat dot com>
Hi,
This patch broke a -Werror native build on ARM for me as so:
---
.../src/binutils-gdb/gdb/gdbserver/../nat/linux-namespaces.c: In function 'mnsh_send_message':
.../src/binutils-gdb/gdb/gdbserver/../nat/linux-namespaces.c:377:28: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'ssize_t {aka int}' [-Werror=format=]
debug_printf (" -> %ld\n", size);
^
.../src/binutils-gdb/gdb/gdbserver/../nat/linux-namespaces.c: In function 'mnsh_recv_message':
.../src/binutils-gdb/gdb/gdbserver/../nat/linux-namespaces.c:429:50: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'ssize_t {aka int}' [-Werror=format=]
debug_printf ("namespace-helper: recv failed (%ld)\n", size);
^
.../src/binutils-gdb/gdb/gdbserver/../nat/linux-namespaces.c:440:53: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'ssize_t {aka int}' [-Werror=format=]
debug_printf ("namespace-helper: recv truncated (%ld 0x%x)\n",
^
---
I would expect that to mean this is broken for any
"long int != ssize_t" target. I'm not sure which C standards GDB requires
compatability with, but I believe the portable C99 way of printing a
ssize_t would be "%zd".
Thanks,
James