[master] f01231959 vmodtool: make vcs_version static & move attribute to a better place

Nils Goroll nils.goroll at uplex.de
Mon Jan 20 18:58:08 UTC 2025


commit f01231959c15092a0b9c056f3b7c2a69365d511b
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Jan 20 19:37:52 2025 +0100

    vmodtool: make vcs_version static & move attribute to a better place
    
    Reported by Flexelint.
    
    Ref c8c016d8abdc9144279fefa2b411e7ebda8af118

diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index f554ce8a8..883fbe365 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -1244,8 +1244,8 @@ class vcc():
         vcs = json.dumps(self.vcs())
         vmd = "Vmod_%s_Data" % self.modname
         fo.write('\n')
-        fo.write('__attribute__((section(".vmod_vcs"), used))\n')
-        fo.write('const char vmod_vcs[] = %s;' % vcs)
+        fo.write('static const char vmod_vcs[] ')
+        fo.write('__attribute__((section(".vmod_vcs"), used)) = %s;\n' % vcs)
         for i in (714, 759, 765):
             fo.write("/*lint -esym(%d, %s) */\n" % (i, vmd))
         fo.write("\nextern const struct vmod_data %s;\n" % vmd)


More information about the varnish-commit mailing list