[ovs-dev] const attributes for some kernel ovs functions ?

Jesse Gross jesse at nicira.com
Wed Jan 15 23:10:35 UTC 2014


On Sat, Jan 11, 2014 at 4:33 PM, Luigi Rizzo <rizzo at iet.unipi.it> wrote:
> Hi,
> in porting the ovs kernel code to the FreeBSD kernel,
> compiling with -Wcast-qual -Werror gives some
>
>    warning: cast discards qualifiers from pointer target type
>
> due to 'const' being ignored. Another couple of warnings
> are on arguments to format strings.

What are the warnings from the format strings? (and I guess, more
specifically, what is the definition of u64 if it is not unsigned long
long?)

> Attached is a trivial patch (partly from Daniele Di Proietto) that
> addresses some of the cases; however, some of them could be
> fixed in different ways.
>
> In particular, vport_priv() and vport_from_priv() should be
> changed to return a const pointer, but this has a bit of
> an avalanche effect on the code and I am not sure if you are
> willing to go for it.

I'm not sure that it's even possible to change those functions to
return a const pointer - it's private space so vport implementations
are allowed to write into it.

> We are happy to submit a proper patch according to your
> preferences.

There's a couple of different issues here so it might be helpful to
break it down into a few separate patches with accompanying commit
messages (and ideally in the context of Linux or generically since it
is Linux-specific code after all). Also, do you have a patch against
master? I'm not sure what branch this is against but it looks somewhat
old.



More information about the dev mailing list