aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-10-08 12:04:41 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-08 14:00:24 +0200
commit42e0dc0cc3d20b4c222151dc7a9b5e63dabac734 (patch)
treee953cc3c3c75febb32968da680dfd69ec6145f22
parentbb9f89745a96dc2b1452a05d4b0e260c276a5779 (diff)
msgb: Add may_alias attribute to struct libgb_msgb_cb
This explicitely allows aliasing of this struct to avoid the warning shown below. Note, that this warning isn't show when '-fno-strict-aliasing' is used. Addresses: gb/gprs_ns_test.c:85:54: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
-rw-r--r--include/osmocom/gprs/gprs_msgb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/osmocom/gprs/gprs_msgb.h b/include/osmocom/gprs/gprs_msgb.h
index f4c85547..e277696b 100644
--- a/include/osmocom/gprs/gprs_msgb.h
+++ b/include/osmocom/gprs/gprs_msgb.h
@@ -16,7 +16,7 @@ struct libgb_msgb_cb {
/* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
uint32_t tlli;
-} __attribute__((packed));
+} __attribute__((packed, may_alias));
#define LIBGB_MSGB_CB(__msgb) ((struct libgb_msgb_cb *)&((__msgb)->cb[0]))
#define msgb_tlli(__x) LIBGB_MSGB_CB(__x)->tlli
#define msgb_nsei(__x) LIBGB_MSGB_CB(__x)->nsei