On Wed, Nov 29, 2017 at 05:13:14PM -0800, Sairam Venugopal wrote:
> Found when compiling the code with C++ binaries. Most of the issues are
> due to missing explicit cast.
> 
> Signed-off-by: Sairam Venugopal <[email protected]>
> Signed-off-by: Shireesh Kumar Singh <[email protected]>
> Co-authored-by: Shireesh Kumar Singh <[email protected]>

Previously I gave some high-level feedback on this change.  Some of that
hasn't been addressed yet, but it still seems appropriate to give some
lower level feedback as well.

checkpatch reports the following:

    ERROR: Inappropriate spacing in pointer declaration
    #211 FILE: lib/packets.h:1139:
            (union ovs_16aligned_in6_addr*) addr;

    ERROR: Inappropriate spacing in pointer declaration
    #222 FILE: lib/packets.h:1156:
            (union ovs_16aligned_in6_addr*) lla;

    ERROR: Inappropriate spacing in pointer declaration
    #224 FILE: lib/packets.h:1158:
            (union ovs_16aligned_in6_addr*) prefix;

    ERROR: Inappropriate spacing in pointer declaration
    #234 FILE: lib/packets.h:1177:
            (union ovs_16aligned_in6_addr*) lla;

    ERROR: Inappropriate spacing in pointer declaration
    WARNING: Line lacks whitespace around operator
    #247 FILE: lib/socket-util.h:141:
        return (setsockopt)(sock, level, optname, (const char*)optval, optlen);

This introduces a new warning with Clang (the right fix is probably to
use ALIGNED_CAST):

    ../lib/netlink.h:156:12: error: cast from 'uint8_t *' (aka 'unsigned char 
*') to 'struct nlattr *' increases required alignment from 1 to 2 
[-Werror,-Wcast-align]

I would prefer to make BUILD_ASSERT work as an expression, rather than
to modify get_unaligned_u64().

Thanks,

Ben.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to