[ovs-dev] sparse issues

Ben Pfaff blp at ovn.org
Wed Dec 13 18:09:34 UTC 2017


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




More information about the dev mailing list