The *_index_init_row() function casts a generic ovsdb_idl_row pointer to
a specific type of row pointer. This can cause an increase in required
alignment with some kinds of data on some architectures. GCC complains,
e.g.:
lib/vswitch-idl.c: In function
'ovsrec_flow_sample_collector_set_index_init_row'
lib/vswitch-idl.c:9277:12: warning: cast increases required alignment of
target
However, rows are always allocated with malloc(), which returns member
suitable for any type, so this is a false positive warning and this commit
suppresses it.
Signed-off-by: Ben Pfaff <[email protected]>
---
ovsdb/ovsdb-idlc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
index 1c9483cbe393..40fef39edff7 100755
--- a/ovsdb/ovsdb-idlc.in
+++ b/ovsdb/ovsdb-idlc.in
@@ -1217,7 +1217,7 @@ struct %(s)s *
%(s)s_index_init_row(struct ovsdb_idl_index *index)
{
ovs_assert(index->table->class_ == &%(p)stable_%(tl)s);
- return (struct %(s)s *) ovsdb_idl_index_init_row(index);
+ return ALIGNED_CAST(struct %(s)s *, ovsdb_idl_index_init_row(index));
}
struct %(s)s *
--
2.16.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev