[master] 6b53be1a0 vcl.rst: Document the new vcl 'unused' directive
Walid Boudebouda
walid.boudebouda at gmail.com
Mon Dec 8 14:34:05 UTC 2025
commit 6b53be1a05140de149a00747ca4b7cdc344c177d
Author: Walid Boudebouda <walid.boudebouda at gmail.com>
Date: Tue Dec 2 10:19:57 2025 +0100
vcl.rst: Document the new vcl 'unused' directive
diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst
index 4814bc92d..f3f779a0d 100644
--- a/doc/sphinx/reference/vcl.rst
+++ b/doc/sphinx/reference/vcl.rst
@@ -436,6 +436,28 @@ subroutine's name::
call pipe_if_local;
}
+Symbol references
+-----------------
+
+Some VCL symbols are subject to reference counting, and would trigger a vcl
+compiler error if they were declared but not used. One way to turn these errors
+into warnings is to add ``-p vcc_feature=-err_unref`` to your ``varnishd``
+command line. This will disable the error globally for all symbols in every VCL
+that is compiled.
+
+If you only want to disable the error for some specific symbols, the ``unused``
+keyword can be used to mark such symbols as intentionally unused::
+
+ backend b1 { .host = "localhost"; }
+ probe p1 { }
+ acl acl1 { "localhost"; }
+ sub sb {}
+
+ unused b1;
+ unused p1;
+ unused acl1;
+ unused sb;
+
Return statements
~~~~~~~~~~~~~~~~~
More information about the varnish-commit
mailing list