[master] 597a34c2d Fix a Flexelint warning which has bothered me for ages.

Poul-Henning Kamp phk at FreeBSD.org
Mon Oct 19 09:38:07 UTC 2020


commit 597a34c2d8b6e8d9e97bb24ccf14361e178440b5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Oct 19 09:32:22 2020 +0000

    Fix a Flexelint warning which has bothered me for ages.
    
    The message makes very little sense when you read it, and it was only
    a pure accident which finally resolved what it means:
    
        Info 768: global struct member 'backend' (line 51, file cache/cache_backend.h) not referenced
        cache/cache_backend.h  51  Info 830: Location cited in prior message
    
    If you have:
    
            struct backend;
    
            void somefunc(struct backend *);
    
            struct backend {
                    ...
            };
    
    All is fine.
    
    But without the `somefunc` prototype, the first vacuous mention of
    `struct backend` is unused, and FlexeLint uses the name *of* the
    struct as the name of a field *in* the struct, and compounds the
    confusion by emitting the message on the line where struct backend
    is finally flushed out.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 4497d20dd..22acb7c7f 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -90,7 +90,6 @@ enum {
 struct VSC_lck;
 struct VSC_main;
 struct VSC_main_wrk;
-struct backend;
 struct ban;
 struct ban_proto;
 struct cli;


More information about the varnish-commit mailing list