summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-09-10 13:00:59 -0700
committerBen Pfaff <blp@ovn.org>2018-09-17 21:54:01 -0700
commit491fdb0e712d98bc60c60bd2d464b43164853c2d (patch)
tree348014e9064c9175543be616689d3728fc4a8b75 /ovsdb
parentbc4fd439586f35b51b7c33708e9e5cf2853298dd (diff)
downloadopenvswitch-491fdb0e712d98bc60c60bd2d464b43164853c2d.tar.gz
ovsdb-idlc: Use ALIGNED_CAST to avoid spurious warnings for index rows.
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 <blp@ovn.org> Acked-by: Han Zhou <zhouhan@gmail.com>
Diffstat (limited to 'ovsdb')
-rwxr-xr-xovsdb/ovsdb-idlc.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
index 1c9483cbe..40fef39ed 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 *