linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v2] core/device: Fix build on some platforms
@ 2015-10-23  5:52 Jakub Pawlowski
  2015-10-23  7:37 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Pawlowski @ 2015-10-23  5:52 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Pawlowski

due to type promotions in C this code was failing on some platforms.

src/device.c:2016:8: error: format specifies type 'unsigned short' but the
      argument has type 'uint8_t' (aka 'unsigned char') [-Werror,-Wformat]
  properties, uuid_str);
  ^~~~~~~~~~
/build/falco/usr/include/bits/stdio2.h:39:7: note: expanded from macro 'sprintf'
                           __VA_ARGS__)
                           ^
---
 src/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index 906a1a7..eb1850e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2015,7 +2015,7 @@ static void store_chrc(struct gatt_db_attribute *attr, void *user_data)
 
 	sprintf(handle, "%04hx", handle_num);
 	bt_uuid_to_string(&uuid, uuid_str, sizeof(uuid_str));
-	sprintf(value, GATT_CHARAC_UUID_STR ":%04hx:%02hx:%s", value_handle,
+	sprintf(value, GATT_CHARAC_UUID_STR ":%04hx:%02hhx:%s", value_handle,
 							properties, uuid_str);
 	g_key_file_set_string(key_file, "Attributes", handle, value);
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ v2] core/device: Fix build on some platforms
  2015-10-23  5:52 [PATCH BlueZ v2] core/device: Fix build on some platforms Jakub Pawlowski
@ 2015-10-23  7:37 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2015-10-23  7:37 UTC (permalink / raw)
  To: Jakub Pawlowski; +Cc: linux-bluetooth

Hi Jakub,

On Thu, Oct 22, 2015, Jakub Pawlowski wrote:
> due to type promotions in C this code was failing on some platforms.
> 
> src/device.c:2016:8: error: format specifies type 'unsigned short' but the
>       argument has type 'uint8_t' (aka 'unsigned char') [-Werror,-Wformat]
>   properties, uuid_str);
>   ^~~~~~~~~~
> /build/falco/usr/include/bits/stdio2.h:39:7: note: expanded from macro 'sprintf'
>                            __VA_ARGS__)
>                            ^
> ---
>  src/device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-23  7:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-23  5:52 [PATCH BlueZ v2] core/device: Fix build on some platforms Jakub Pawlowski
2015-10-23  7:37 ` 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).