* [PATCH] Fix compilation error in mgmt/main.c
@ 2012-01-18 12:23 Szymon Janc
2012-01-18 12:29 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2012-01-18 12:23 UTC (permalink / raw)
To: linux-bluetooth; +Cc: kanak.gupta, Szymon Janc
Use %u instead of %zu for printing len which is of type uint16_t.
CC mgmt/main.o
cc1: warnings being treated as errors
mgmt/main.c: In function ‘mgmt_device_found’:
mgmt/main.c:561: error: format ‘%zu’ expects type ‘size_t’, but argument 4 has type ‘int’
---
mgmt/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mgmt/main.c b/mgmt/main.c
index 096a8a4..ecb922d 100644
--- a/mgmt/main.c
+++ b/mgmt/main.c
@@ -557,7 +557,7 @@ static int mgmt_device_found(int mgmt_sk, uint16_t index,
eir_len = bt_get_le16(&ev->eir_len);
if (len != sizeof(*ev) + eir_len) {
- fprintf(stderr, "dev_found: expected %zu bytes, got %zu bytes",
+ fprintf(stderr, "dev_found: expected %zu bytes, got %u bytes",
sizeof(*ev) + eir_len, len);
return -EINVAL;
}
--
on behalf of ST-Ericsson
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix compilation error in mgmt/main.c
2012-01-18 12:23 [PATCH] Fix compilation error in mgmt/main.c Szymon Janc
@ 2012-01-18 12:29 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2012-01-18 12:29 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth, kanak.gupta
Hi Szymon,
On Wed, Jan 18, 2012, Szymon Janc wrote:
> Use %u instead of %zu for printing len which is of type uint16_t.
>
> CC mgmt/main.o
> cc1: warnings being treated as errors
> mgmt/main.c: In function ‘mgmt_device_found’:
> mgmt/main.c:561: error: format ‘%zu’ expects type ‘size_t’, but argument 4 has type ‘int’
> ---
> mgmt/main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Thanks, but you were a bit too slow: I already pushed the same fix
myself (I didn't initially catch this error in my 32 bit qemu vm but
when compiling outside in a 64 bit env I saw it).
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-18 12:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-18 12:23 [PATCH] Fix compilation error in mgmt/main.c Szymon Janc
2012-01-18 12:29 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).