linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] monitor: fix usage of size_t %z formater
@ 2022-06-29 19:19 Brian Gix
  2022-06-29 21:29 ` [BlueZ] " bluez.test.bot
  2022-06-29 23:49 ` [PATCH BlueZ] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Gix @ 2022-06-29 19:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.von.dentz, brian.gix

Some versions of GCC use strict typing for the %z formater, so passing
an argument of type uint64_t instead of size_t throws an error.
---
 monitor/l2cap.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/monitor/l2cap.h b/monitor/l2cap.h
index 00a8ffbbd..86113e59d 100644
--- a/monitor/l2cap.h
+++ b/monitor/l2cap.h
@@ -291,7 +291,7 @@ static inline bool l2cap_frame_print_be64(struct l2cap_frame *frame,
 		return false;
 	}
 
-	print_field("%s: 0x%zx", label, u64);
+	print_field("%s: 0x%zx", label, (size_t)u64);
 
 	return true;
 }
@@ -320,7 +320,7 @@ static inline bool l2cap_frame_print_le64(struct l2cap_frame *frame,
 		return false;
 	}
 
-	print_field("%s: 0x%zx", label, u64);
+	print_field("%s: 0x%zx", label, (size_t)u64);
 
 	return true;
 }
-- 
2.36.1


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

* RE: [BlueZ] monitor: fix usage of size_t %z formater
  2022-06-29 19:19 [PATCH BlueZ] monitor: fix usage of size_t %z formater Brian Gix
@ 2022-06-29 21:29 ` bluez.test.bot
  2022-06-29 23:49 ` [PATCH BlueZ] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-06-29 21:29 UTC (permalink / raw)
  To: linux-bluetooth, brian.gix

[-- Attachment #1: Type: text/plain, Size: 995 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=655153

---Test result---

Test Summary:
CheckPatch                    PASS      0.75 seconds
GitLint                       PASS      0.53 seconds
Prep - Setup ELL              PASS      42.41 seconds
Build - Prep                  PASS      0.50 seconds
Build - Configure             PASS      8.27 seconds
Build - Make                  PASS      1398.73 seconds
Make Check                    PASS      11.07 seconds
Make Check w/Valgrind         PASS      430.93 seconds
Make Distcheck                PASS      228.60 seconds
Build w/ext ELL - Configure   PASS      8.40 seconds
Build w/ext ELL - Make        PASS      1384.88 seconds
Incremental Build with patchesPASS      0.00 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] monitor: fix usage of size_t %z formater
  2022-06-29 19:19 [PATCH BlueZ] monitor: fix usage of size_t %z formater Brian Gix
  2022-06-29 21:29 ` [BlueZ] " bluez.test.bot
@ 2022-06-29 23:49 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-06-29 23:49 UTC (permalink / raw)
  To: Brian Gix; +Cc: linux-bluetooth, luiz.von.dentz

Hi Brian,

On Wed, Jun 29, 2022 at 12:49 PM Brian Gix <brian.gix@intel.com> wrote:
>
> Some versions of GCC use strict typing for the %z formater, so passing
> an argument of type uint64_t instead of size_t throws an error.
> ---
>  monitor/l2cap.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/monitor/l2cap.h b/monitor/l2cap.h
> index 00a8ffbbd..86113e59d 100644
> --- a/monitor/l2cap.h
> +++ b/monitor/l2cap.h
> @@ -291,7 +291,7 @@ static inline bool l2cap_frame_print_be64(struct l2cap_frame *frame,
>                 return false;
>         }
>
> -       print_field("%s: 0x%zx", label, u64);
> +       print_field("%s: 0x%zx", label, (size_t)u64);
>
>         return true;
>  }
> @@ -320,7 +320,7 @@ static inline bool l2cap_frame_print_le64(struct l2cap_frame *frame,
>                 return false;
>         }
>
> -       print_field("%s: 0x%zx", label, u64);
> +       print_field("%s: 0x%zx", label, (size_t)u64);
>
>         return true;
>  }
> --
> 2.36.1

I suspend we need to use something like PRIu64 macros, like we already
do in some of our code e.g.:

src/adapter.c:          sscanf(rand, "%" PRIu64, &ltk->rand);


-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2022-06-29 23:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29 19:19 [PATCH BlueZ] monitor: fix usage of size_t %z formater Brian Gix
2022-06-29 21:29 ` [BlueZ] " bluez.test.bot
2022-06-29 23:49 ` [PATCH BlueZ] " Luiz Augusto von Dentz

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).