[master] 931ef7d Emit __match_proto__() for compiled functions

Poul-Henning Kamp phk at varnish-cache.org
Thu Jun 14 15:19:56 CEST 2012


commit 931ef7d8c4a3c24574c5411ef69c1fb76efb3ae6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jun 14 12:49:04 2012 +0000

    Emit __match_proto__() for compiled functions

diff --git a/lib/libvcl/vcc_compile.c b/lib/libvcl/vcc_compile.c
index db8b37a..a16fbed 100644
--- a/lib/libvcl/vcc_compile.c
+++ b/lib/libvcl/vcc_compile.c
@@ -609,6 +609,8 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
 	/* Macro for accessing directors */
 	Fh(tl, 0, "#define VGCDIR(n) VCL_conf.director[VGC_backend_##n]\n");
 
+	Fh(tl, 0, "#define __match_proto__(xxx)		/*lint -e{818} */\n");
+
 	/* Register and lex the main source */
 	VTAILQ_INSERT_TAIL(&tl->sources, sp, list);
 	sp->idx = tl->nsources++;
@@ -669,7 +671,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
 
 	/* Emit method functions */
 	for (i = 0; i < VCL_MET_MAX; i++) {
-		Fc(tl, 1, "\nstatic int\n");
+		Fc(tl, 1, "\nstatic int __match_proto__(vcl_func_f)\n");
 		Fc(tl, 1, "VGC_function_%s(struct sess *sp, struct req *req)\n",
 		    method_tab[i].name);
 		AZ(VSB_finish(tl->fm[i]));
diff --git a/lib/libvcl/vcc_parse.c b/lib/libvcl/vcc_parse.c
index 369aca8..1a6bbf3 100644
--- a/lib/libvcl/vcc_parse.c
+++ b/lib/libvcl/vcc_parse.c
@@ -227,7 +227,7 @@ vcc_Function(struct vcc *tl)
 		Fh(tl, 0, "static int VGC_function_%.*s "
 		    "(struct sess *, struct req *);\n",
 		    PF(tl->t));
-		Fc(tl, 1, "\nstatic int\n");
+		Fc(tl, 1, "\nstatic int __match_proto__(vcl_func_t)\n");
 		Fc(tl, 1, "VGC_function_%.*s"
 		    "(struct sess *sp, struct req *req)\n",
 		    PF(tl->t));



More information about the varnish-commit mailing list