Commit ef20272c authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Make sure to use none backends in generated C code

Otherwise you might run into this:

    Message from VCC-compiler:
    Unused backend nil, defined:
    ('<vcl.inline>' Line 4 Pos 17)
            backend nil none;
    ----------------###------

    (That was just a warning)
    Message from C-compiler:
    vgc.c:1476:20: error: unused variable 'vgc_backend_nil' [-Werror,-Wunused-variable]
    static VCL_BACKEND vgc_backend_nil;
                       ^
    1 error generated.
    Running C-compiler failed, exited with 1
    VCL compilation failed

This is done in both init and discard code to maintain the balance.
parent e8e4d489
......@@ -43,3 +43,9 @@ client c1 {
rxresp
expect resp.status == 503
} -run
varnish v1 -cliok "param.set vcc_err_unref off"
varnish v1 -vcl {
backend bad { .host = "${bad_backend}"; }
backend nil none;
}
......@@ -330,6 +330,9 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
Fb(tl, 0, "\n\t%s = (NULL);\n", vgcname);
vcc_NextToken(tl);
SkipToken(tl, ';');
ifp = New_IniFin(tl);
VSB_printf(ifp->ini, "\t(void)%s;\n", vgcname);
VSB_printf(ifp->fin, "\t\t(void)%s;\n", vgcname);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment