[MERGED] libosmocore[master]: osmo_msgbdump_{l2, l3}(): Proper typecast

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Feb 9 10:28:13 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: osmo_msgbdump_{l2,l3}(): Proper typecast
......................................................................


osmo_msgbdump_{l2,l3}(): Proper typecast

This avoids compiler warnings like

/tmp/work/sysmobts_v2-poky-linux-gnueabi/osmo-pcu/0.4+gitAUTOINC+4c112dc5a6-r1.18/recipe-sysroot/usr/include/osmocom/core/msgb.h: In function 'const char* msgb_hexdump_l2(const msgb*)':
error: invalid conversion from 'void*' to 'const unsigned char*' [-fpermissive]
    return osmo_hexdump(msgb_l2(msg), msgb_l2len(msg));

which we've been getting in osmo-pcu builds on some platforms.

Change-Id: I0ec652a1a569ec1507d8411cf1ef87afabcca799
---
M include/osmocom/core/msgb.h
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 9f4c444..374ddbe 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -513,14 +513,14 @@
 {
 	if (!msgb_l2(msg) || !(msgb_l2len(msg)))
 		return "[]";
-	return osmo_hexdump(msgb_l2(msg), msgb_l2len(msg));
+	return osmo_hexdump((const unsigned char *) msgb_l2(msg), msgb_l2len(msg));
 }
 
 static inline const char *msgb_hexdump_l3(const struct msgb *msg)
 {
 	if (!msgb_l3(msg) || !(msgb_l3len(msg)))
 		return "[]";
-	return osmo_hexdump(msgb_l3(msg), msgb_l3len(msg));
+	return osmo_hexdump((const unsigned char*) msgb_l3(msg), msgb_l3len(msg));
 }
 
 /*! @} */

-- 
To view, visit https://gerrit.osmocom.org/6340
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ec652a1a569ec1507d8411cf1ef87afabcca799
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list