[master] 95b8ecc More Flexelintery
Poul-Henning Kamp
phk at FreeBSD.org
Wed Apr 26 14:58:05 CEST 2017
commit 95b8eccd379bce2e7e8e5182ed0d25567e6d65fd
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Apr 26 12:57:33 2017 +0000
More Flexelintery
diff --git a/bin/flint.lnt b/bin/flint.lnt
index 55d2f4a..dadd62d 100644
--- a/bin/flint.lnt
+++ b/bin/flint.lnt
@@ -37,6 +37,4 @@
-emacro(702, WEXITSTATUS) // signed shift right
--e726 // Extraneous comma ignored
-
-e825 // control flows into case/default without -fallthrough comment
diff --git a/bin/varnishd/flint.lnt b/bin/varnishd/flint.lnt
index f0667fd..5432486 100644
--- a/bin/varnishd/flint.lnt
+++ b/bin/varnishd/flint.lnt
@@ -115,9 +115,7 @@
-e455 // thread lock
-e458 // unprotected read
--e716 // while(1) ...
-e717 // do ... while(1) ...
--e785 // Too few initializers for aggregate
-e850 // for loop index variable '___' whose type category is '___'
// is modified in body of the for loop that began at '___'
diff --git a/bin/varnishd/vclflint.lnt b/bin/varnishd/vclflint.lnt
index 74ba97c..de6aaab 100644
--- a/bin/varnishd/vclflint.lnt
+++ b/bin/varnishd/vclflint.lnt
@@ -4,9 +4,6 @@
-esym(763, sess) // Redundant declaration for symbol 'sess'
-esym(763, cli) // Redundant declaration for symbol 'cli'
--e785 // Too few initializers for aggregate '___' of type '___'
-
-
-esym(750, VCL_RET_*) // not ref
-esym(750, VCL_MET_*) // not ref
diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index 9d0fc45..51c5038 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -130,7 +130,7 @@ static const struct profile profiles[] = {
static const struct profile *active_profile;
-volatile sig_atomic_t quit = 0;
+static volatile sig_atomic_t quit = 0;
static void
update(void)
diff --git a/bin/varnishhist/varnishhist_options.h b/bin/varnishhist/varnishhist_options.h
index 055681b..a9bedea 100644
--- a/bin/varnishhist/varnishhist_options.h
+++ b/bin/varnishhist/varnishhist_options.h
@@ -78,11 +78,11 @@ HIS_OPT_p
#define HIS_CLIENT "client"
#define HIS_BACKEND "backend"
#define HIS_NO_PREFIX ""
-#define HIS_PROF(name,cb,tag,prefix,field,hist_low,high_high,doc) \
+#define HIS_PROF(name,cb,tg,prefix,fld,hist_low,high_high,doc) \
VOPT("P:", "[-P " name "]", \
"Predefined " cb " profile", \
"Predefined " cb " profile: " doc \
- " (field " #field " of " #tag " " prefix " VSL tag)." \
+ " (field " #fld " of " #tg " " prefix " VSL tag)." \
)
#include "varnishhist_profiles.h"
#undef HIS_NO_PREFIX
diff --git a/bin/varnishlog/flint.lnt b/bin/varnishlog/flint.lnt
index 7d06a3e..5600f42 100644
--- a/bin/varnishlog/flint.lnt
+++ b/bin/varnishlog/flint.lnt
@@ -2,7 +2,6 @@
-e747 // 16 Info 747 Significant prototype coercion (___) ___ to ___
-e763 // Redundant declaration for symbol '...' previously declared
--e716 // while(1) ...
-efile(451, "varnishlog_options.h")
diff --git a/bin/varnishncsa/flint.lnt b/bin/varnishncsa/flint.lnt
index f9fb415..d2a0b91 100644
--- a/bin/varnishncsa/flint.lnt
+++ b/bin/varnishncsa/flint.lnt
@@ -4,9 +4,6 @@
-efile(451, "varnishncsa_options.h")
-e763 // Redundant declaration for symbol '...' previously declared
--e726 // Extraneous comma ignored
--e716 // while(1) ...
--e785 // Too few initializers for aggregate
// cache_vcl.c
-e641 // Converting enum 'cli_status_e' to int
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 2a94519..65ed5c5 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -70,7 +70,6 @@
static const char progname[] = "varnishncsa";
struct format;
-struct fragment;
enum e_frag {
F_H, /* %H Proto */
diff --git a/bin/varnishstat/flint.lnt b/bin/varnishstat/flint.lnt
index eaa89be..45b5b0e 100644
--- a/bin/varnishstat/flint.lnt
+++ b/bin/varnishstat/flint.lnt
@@ -9,7 +9,6 @@
-e747 // 16 Info 747 Significant prototype coercion (___) ___ to ___
-e763 // Redundant declaration for symbol '...' previously declared
--e716 // while(1) ...
-e457 // unprotected write access
-e459 // unprotected access
diff --git a/bin/varnishtest/flint.lnt b/bin/varnishtest/flint.lnt
index 6e82dd6..786b758 100644
--- a/bin/varnishtest/flint.lnt
+++ b/bin/varnishtest/flint.lnt
@@ -20,7 +20,6 @@
-e679 // Suspicious Truncation in arithmetic expression combining with pointer
-e763 // Redundant declaration for symbol '...' previously declared
--e716 // while(1) ...
-e457 // unprotected write access
-e459 // unprotected access
diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index b84b40f..9b60ba4 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -51,7 +51,6 @@
#include "vnum.h"
#include "vqueue.h"
#include "vrnd.h"
-#include "vsa.h"
#include "vss.h"
#include "vsub.h"
#include "vtcp.h"
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index d20e82a..f098ef8 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -50,7 +50,6 @@
#include "vapi/vsm.h"
#include "vcli.h"
#include "vre.h"
-#include "vss.h"
#include "vsub.h"
#include "vtcp.h"
#include "vtim.h"
diff --git a/bin/varnishtop/flint.lnt b/bin/varnishtop/flint.lnt
index 4920e47..a91f0a3 100644
--- a/bin/varnishtop/flint.lnt
+++ b/bin/varnishtop/flint.lnt
@@ -3,7 +3,6 @@
-e747 // 16 Info 747 Significant prototype coercion (___) ___ to ___
-e763 // Redundant declaration for symbol '...' previously declared
--e716 // while(1) ...
-e457 // unprotected write access
-e459 // unprotected access
diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
index 6af08a1..af486a7 100644
--- a/bin/varnishtop/varnishtop.c
+++ b/bin/varnishtop/varnishtop.c
@@ -78,7 +78,7 @@ static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
static int f_flag = 0;
static unsigned maxfieldlen = 0;
-volatile sig_atomic_t quit = 0;
+static volatile sig_atomic_t quit = 0;
static VRB_HEAD(t_order, top) h_order = VRB_INITIALIZER(&h_order);
static VRB_HEAD(t_key, top) h_key = VRB_INITIALIZER(&h_key);
diff --git a/flint.lnt b/flint.lnt
index 43917a9..35d7f0e 100644
--- a/flint.lnt
+++ b/flint.lnt
@@ -19,10 +19,12 @@
///////////////////////////////////////////////////////////////////////
// General stylistic issues
-e641 // Converting enum '...' to int
+-e716 // while(1) ...
-e726 // Extraneous comma ignored
-e728 // Symbol ... not explicitly initialized
-e763 // Redundant declaration for symbol '...' previously declared
-e777 // Testing floats for equality
+-e785 // Too few initializers for aggregate
-e786 // String concatenation within initializer
-esym(818, argv) // Pointer parameter '...' could be declared as pointing to const
@@ -121,11 +123,20 @@
-emacro(740, VTAILQ_LAST) // Unusual pointer cast (incompatible indirect types)
-emacro(740, VTAILQ_PREV) // Unusual pointer cast (incompatible indirect types)
+-esym(754, "*::vtqh_first") // local struct member '...' not referenced
+
///////////////////////////////////////////////////////////////////////
// <vdef.h>
-emacro(527, NEEDLESS) // unreachable code
///////////////////////////////////////////////////////////////////////
+// <libvarnishapi>
+
+-esym(765, vsl_vbm_bitclr)
+-esym(765, vsl_vbm_bitset)
+-esym(765, vsm_diag)
+
+///////////////////////////////////////////////////////////////////////
// It is ok to default after handling a few select SLT_* tags
-esym(788, VSL_tag_e::SLT_*) // enum constant '...' not used within defaulted switch
diff --git a/lib/libvarnish/flint.lnt b/lib/libvarnish/flint.lnt
index 2ac9733..f246d5c 100644
--- a/lib/libvarnish/flint.lnt
+++ b/lib/libvarnish/flint.lnt
@@ -26,9 +26,6 @@
-ffc // No automatic custody
-e763 // Redundant declaration for symbol '...' previously declared
--e726 // Extraneous comma ignored
--e716 // while(1) ...
--e785 // Too few initializers for aggregate
-esym(534, sprintf) // Ignoring return value of function
-esym(534, asprintf) // Ignoring return value of function
diff --git a/lib/libvarnishapi/daemon.c b/lib/libvarnishapi/daemon.c
index 33b8552..feb7924 100644
--- a/lib/libvarnishapi/daemon.c
+++ b/lib/libvarnishapi/daemon.c
@@ -68,7 +68,7 @@ varnish_daemon(int nochdir, int noclose)
int osa_ok;
/* A SIGHUP may be thrown when the parent exits below. */
- sigemptyset(&sa.sa_mask);
+ AZ(sigemptyset(&sa.sa_mask));
sa.sa_handler = SIG_IGN;
sa.sa_flags = 0;
osa_ok = sigaction(SIGHUP, &sa, &osa);
@@ -89,7 +89,7 @@ varnish_daemon(int nochdir, int noclose)
newgrp = setsid();
oerrno = errno;
if (osa_ok != -1)
- sigaction(SIGHUP, &osa, NULL);
+ AZ(sigaction(SIGHUP, &osa, NULL));
if (newgrp == -1) {
errno = oerrno;
diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index 74c567e..5165620 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -378,7 +378,7 @@ vsc_filter_pt_list(struct VSM_data *vd)
VSB_printf(vsb, "%s.",
pt->point.section->ident);
VSB_printf(vsb, "%s", pt->point.desc->name);
- VSB_finish(vsb);
+ AZ(VSB_finish(vsb));
if (fnmatch(sf->pattern, VSB_data(vsb), 0))
continue;
VTAILQ_REMOVE(&vsc->pt_list, pt, list);
diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index a6e0f21..f1b1846 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -418,7 +418,7 @@ VSL_WriteOpen(struct VSL_data *vsl, const char *name, int append, int unbuf)
if (0 == ftell(f)) {
if (fwrite(head, 1, sizeof head, f) != sizeof head) {
vsl_diag(vsl, "%s", strerror(errno));
- fclose(f);
+ (void)fclose(f);
return (NULL);
}
}
diff --git a/lib/libvarnishapi/vsl_api.h b/lib/libvarnishapi/vsl_api.h
index c77ba28..8aef719 100644
--- a/lib/libvarnishapi/vsl_api.h
+++ b/lib/libvarnishapi/vsl_api.h
@@ -32,8 +32,7 @@
#define VSL_FILE_ID "VSL"
/*lint -esym(534, vsl_diag) */
-int vsl_diag(struct VSL_data *vsl, const char *fmt, ...)
- __v_printflike(2, 3);
+int vsl_diag(struct VSL_data *vsl, const char *fmt, ...) __v_printflike(2, 3);
void vsl_vbm_bitset(int bit, void *priv);
void vsl_vbm_bitclr(int bit, void *priv);
diff --git a/lib/libvcc/flint.lnt b/lib/libvcc/flint.lnt
index 50a8868..7160b2e 100644
--- a/lib/libvcc/flint.lnt
+++ b/lib/libvcc/flint.lnt
@@ -26,7 +26,6 @@
-esym(534, vsb_vprintf) // Ignoring return value of function
-esym(534, memset) // Ignoring return value of function
-e788 // enum constant 'HND_Unclass' not used within defaulted switch
--e716 // while(1) ...
-e732 // Loss of sign (arg. no. 2) (int to unsigned int)
-emacro(835, EXPR_VAR) // // Info 835: A zero has been given as right argument to operator '<<'
diff --git a/lib/libvmod_directors/shard_dir.c b/lib/libvmod_directors/shard_dir.c
index 90a35fa..aa56483 100644
--- a/lib/libvmod_directors/shard_dir.c
+++ b/lib/libvmod_directors/shard_dir.c
@@ -209,7 +209,7 @@ sharddir_delete(struct sharddir **sharddp)
FREE_OBJ(shardd);
}
-void
+static void
sharddir_rdlock(struct sharddir *shardd)
{
CHECK_OBJ_NOTNULL(shardd, SHARDDIR_MAGIC);
diff --git a/lib/libvmod_directors/shard_dir.h b/lib/libvmod_directors/shard_dir.h
index de35c41..35a947c 100644
--- a/lib/libvmod_directors/shard_dir.h
+++ b/lib/libvmod_directors/shard_dir.h
@@ -105,7 +105,6 @@ void sharddir_debug(struct sharddir *shardd, const uint32_t flags);
void sharddir_err(VRT_CTX, enum VSL_tag_e tag, const char *fmt, ...);
void sharddir_new(struct sharddir **sharddp, const char *vcl_name);
void sharddir_delete(struct sharddir **sharddp);
-void sharddir_rdlock(struct sharddir *shardd);
void sharddir_wrlock(struct sharddir *shardd);
void sharddir_unlock(struct sharddir *shardd);
VCL_BACKEND sharddir_pick_be(VRT_CTX, struct sharddir *, uint32_t, VCL_INT,
More information about the varnish-commit
mailing list