[master] b83c68d Formailize some of the macro-crutches I use to explain stuff to FlexeLint.

Poul-Henning Kamp phk at varnish-cache.org
Thu Dec 15 10:32:25 CET 2011


commit b83c68dd51ed522aac12129ecf6e45adbc28ea4f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Dec 15 09:21:45 2011 +0000

    Formailize some of the macro-crutches I use to explain stuff to FlexeLint.

diff --git a/bin/varnishd/common/common.h b/bin/varnishd/common/common.h
index 2ff5623..3509f25 100644
--- a/bin/varnishd/common/common.h
+++ b/bin/varnishd/common/common.h
@@ -42,6 +42,26 @@
 
 struct cli;
 
+/**********************************************************************
+ * FlexeLint and compiler shutuppery
+ */
+
+/*
+ * In OO-light situations, functions have to match their prototype
+ * even if that means not const'ing a const'able argument.
+ * The typedef should be specified as argument to the macro.
+ */
+#define __match_proto__(xxx)		/*lint -e{818} */
+
+/*
+ * State variables may change value before we use the last value we
+ * set them to.
+ * Pass no argument.
+ */
+#define __state_variable__(xxx)		/*lint -esym(838,xxx) */
+
+/**********************************************************************/
+
 /* Name of transient storage */
 #define TRANSIENT_STORAGE	"Transient"
 
@@ -52,8 +72,6 @@ extern pid_t mgt_pid;
 extern struct vsb *vident;		// XXX: -> heritage ?
 int Symbol_Lookup(struct vsb *vsb, void *ptr);
 
-/* Help shut up FlexeLint */
-#define __match_proto__(xxx) /*lint -e{818} */
 
 /* Really belongs in mgt.h, but storage_file chokes on both */
 void mgt_child_inherit(int fd, const char *what);



More information about the varnish-commit mailing list