[ovs-dev] [sparc 1/5] netlink: Avoid "cast increases required alignment of target type" on RISC.

Justin Pettit jpettit at nicira.com
Thu May 26 08:48:35 UTC 2011


Looks good.

--Justin


On May 24, 2011, at 11:21 AM, Ben Pfaff wrote:

> This warning doesn't indicate a genuine problem, since 'nla' must be
> aligned properly and NLA_ALIGN ensures that the offset is aligned properly
> too.  Casting via void * suppresses the warning.
> ---
> lib/netlink.h |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/netlink.h b/lib/netlink.h
> index b1bf585..0bd2c41 100644
> --- a/lib/netlink.h
> +++ b/lib/netlink.h
> @@ -98,7 +98,7 @@ enum nl_attr_type
> static inline struct nlattr *
> nl_attr_next(const struct nlattr *nla)
> {
> -    return (struct nlattr *) ((uint8_t *) nla + NLA_ALIGN(nla->nla_len));
> +    return (void *) ((uint8_t *) nla + NLA_ALIGN(nla->nla_len));
> }
> 
> static inline bool
> -- 
> 1.6.5
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list