summaryrefslogtreecommitdiffstats
path: root/ctdb/common
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-08-04 14:50:17 +1000
committerAmitay Isaacs <amitay@samba.org>2014-08-21 04:46:13 +0200
commit6fd3ce53914c5c5aa79b972b42258c722b227b88 (patch)
treee0b50671191e1546be49ed5e1ff65324c7cb96d1 /ctdb/common
parent2807b185f438c40544d4fd133bc386e411b12d0c (diff)
downloadsamba-6fd3ce53914c5c5aa79b972b42258c722b227b88.tar.gz
samba-6fd3ce53914c5c5aa79b972b42258c722b227b88.tar.xz
samba-6fd3ce53914c5c5aa79b972b42258c722b227b88.zip
ctdb-daemon: Fix some strict-aliasing warnings
Seeing these with -Wall: ../server/ctdb_call.c:1117:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] record_flags = *(uint32_t *)&c->data[c->keylen + c->datalen]; ^ memcpy() seems to be the easiest way to get fix these. The alternative would be to use unmarshalling functions. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/common')
-rw-r--r--ctdb/common/ctdb_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index b16e9cc42a..b9b0ad7a91 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -327,7 +327,7 @@ struct ctdb_rec_data *ctdb_marshall_loop_next(struct ctdb_marshall_buffer *m, st
if (r->datalen < sizeof(*header)) {
return NULL;
}
- *header = *(struct ctdb_ltdb_header *)&r->data[r->keylen];
+ memcpy(header, &r->data[r->keylen], sizeof(*header));
}
return r;