[master] dc69d1c13 make vmodtool reject arguments of type VOID

Nils Goroll nils.goroll at uplex.de
Wed Feb 20 08:41:07 UTC 2019

commit dc69d1c136f248b56686c7abd9b3d82ab367737d
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Feb 20 09:38:04 2019 +0100

    make vmodtool reject arguments of type VOID
    VOID is only valid as a return type. If VOID was used as an argument,
    the C compiler would bail out, yet we should better check this early.
    Looking through CTYPES, VOID seems to be the only type not valid for
    arguments, thus the explicit check.

diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index fe2a45161..30e9a50f9 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -359,6 +359,8 @@ class ProtoType(object):
                 self.argstruct = True
                 t = arg(wl, names, st.vcc.enums, ',')
+            if t.vt == 'VOID':
+                err("arguments can not be of type '%s'" % t.vt, warn=False)
             if t.nm is None:
                 t.nm2 = "arg%d" % n

More information about the varnish-commit mailing list