[ovs-dev] sparse issues

Guru Shetty guru at ovn.org
Wed Dec 13 22:29:53 UTC 2017


Usually when devs have told me that sparse does not work for them, I ask
them not to install sparse with 'apt-get install' but rather to compile it
from source code (git://git.kernel.org/pub/scm/devel/sparse/sparse.git) and
then copy the binary to a PATH. And their problems usually disappear.

On 13 December 2017 at 10:09, Ben Pfaff <blp at ovn.org> wrote:

> There's been some talk about how sparse isn't working properly for you
> or some others.  Let's try to figure that out.
>
> A few possibilities come to mind:
>
> - Maybe sparse isn't being detected at configure time.  If it is
>   detected, then Makefile should contain a nasty mess of a "make"
>   conditional expression for the definition of CC; if not, then it
>   should look normal.
>
> - Maybe "make" isn't being run with C=1.
>
> - --enable-Werror doesn't properly make the build fail when sparse
>   reports a warning.  This means that it's easy to miss the warnings
>   if you run "make" twice.
>
> Here's something you can try.  Apply a patch like the following, then
> run "make clean; make C=1".  Do you get a huge pile of error messages
> from sparse?  I do.
>
> diff --git a/include/sparse/netinet/in.h b/include/sparse/netinet/in.h
> index c28158ca02f5..93b0bac83997 100644
> --- a/include/sparse/netinet/in.h
> +++ b/include/sparse/netinet/in.h
> @@ -14,6 +14,8 @@
>   * limitations under the License.
>   */
>
> +#error
> +
>  #ifndef __CHECKER__
>  #error "Use this header only with sparse.  It is not a correct
> implementation."
>  #endif
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>


More information about the dev mailing list