[Varnish] #1357: VCL sub gives compiler warning in master/a44b3a8

Varnish varnish-bugs at varnish-cache.org
Sat Oct 12 13:44:43 CEST 2013


#1357: VCL sub gives compiler warning in master/a44b3a8
----------------------+-------------------
 Reporter:  lkarsten  |      Owner:
     Type:  defect    |     Status:  new
 Priority:  normal    |  Milestone:
Component:  varnishd  |    Version:  trunk
 Severity:  minor     |   Keywords:
----------------------+-------------------
 {{{
 root at lb1:~# /opt/varnish/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T
 localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s
 malloc,3500m -p send_timeout=3600s
 Message from C-compiler:
 ./vcl.R82gfsuj.c: In function ‘VGC_function_vcl_recv’:
 ./vcl.R82gfsuj.c:894:7: warning: passing argument 1 of
 ‘VGC_function_devicedetect’ discards ‘const’ qualifier from pointer target
 type [enabled by default]
 ./vcl.R82gfsuj.c:712:1: note: expected ‘struct vrt_ctx *’ but argument is
 of type ‘const struct vrt_ctx *’
 ./vcl.R82gfsuj.c:896:7: warning: passing argument 1 of
 ‘VGC_function_removeGA’ discards ‘const’ qualifier from pointer target
 type [enabled by default]
 ./vcl.R82gfsuj.c:857:1: note: expected ‘struct vrt_ctx *’ but argument is
 of type ‘const struct vrt_ctx *’
 root at lb1:~#
 }}}

 I belive this can be reproduced with this VCL:
 {{{
 sub removeGA {
     if (req.http.Cookie) {
         # removes all cookies named __utm? (utma, utmb...) - tracking
 thing
         set req.http.Cookie = regsuball(req.http.Cookie, "(^|; )
 *__utm.=[^;]+;? *", "\1");
     }
     if (req.http.Cookie == "") { unset req.http.Cookie; }
 }

 sub vcl_recv {
     call removeGA;
 }
 }}}
 (untested, but this seems pretty clear cut)

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1357>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list