Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh ubuntu 20.04, default varnish-6.2.1 build error #8

Open
laurentdebricon opened this issue Aug 21, 2020 · 1 comment
Open

Fresh ubuntu 20.04, default varnish-6.2.1 build error #8

laurentdebricon opened this issue Aug 21, 2020 · 1 comment

Comments

@laurentdebricon
Copy link

laurentdebricon commented Aug 21, 2020

Building error:

accept-language.c: In function ‘is_supported’:
accept-language.c:66:5: warning: ‘strncpy’ output truncated before terminating nul copying 1 byte from a string of the same length [-Wstringop-truncation]
   66 |     strncpy(match_str, ":", 1);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
accept-language.c: In function ‘main’:
accept-language.c:186:9: warning: ‘strncpy’ output truncated before terminating nul copying 2 bytes from a string of the same length [-Wstringop-truncation]
  186 |         strncpy(lang, "??", 2);

Looking for a solution. I have been using this repo for many years ...
default ubuntu 20.04 gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0

@laurentdebricon
Copy link
Author

Replacing strncpy by memcpy makes the build ok,
but then testing my script

varnishd -C -f /etc/varnish/myscript_that_include_accept_language.vcl -p vcc_allow_inline_c=on

Message from C-compiler:
vgc.c: In function ‘vcl_rewrite_accept_language’:
vgc.c:2544:25: error: passing argument 1 of ‘VRT_GetHdr’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2544 |     in_hdr = VRT_GetHdr(sp, HDR_REQ, "\020Accept-Language:");
      |                         ^~
      |                         |
      |                         const struct sess *
vgc.c:413:40: note: expected ‘const struct vrt_ctx *’ but argument is of type ‘const struct sess *’
  413 | #define VRT_CTX  const struct vrt_ctx *ctx
      |                  ~~~~~~~~~~~~~~~~~~~~~~^~~
vgc.c:579:23: note: in expansion of macro ‘VRT_CTX’
[32 lines truncated]
Running C-compiler failed, exited with 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant