INN commit: trunk (configure.ac history/hisv6/hisv6.c nnrpd/group.c)

INN Commit rra at isc.org
Sat Nov 11 16:36:30 UTC 2017


    Date: Saturday, November 11, 2017 @ 08:36:30
  Author: iulius
Revision: 10189

Enforce new gcc warnings

-Wshadow, -Wc99-c11-compat, -Wc++-compat, and -Wdate-time are now
used when building INN with warnings on.

Note that the behaviour of -Wshadow changed in GCC 4.8 and no longer
gives unwanted noise.

Modified:
  trunk/configure.ac
  trunk/history/hisv6/hisv6.c
  trunk/nnrpd/group.c

-----------------------+
 configure.ac          |    7 +++----
 history/hisv6/hisv6.c |    1 -
 nnrpd/group.c         |   10 +++++-----
 3 files changed, 8 insertions(+), 10 deletions(-)

Modified: configure.ac
===================================================================
--- configure.ac	2017-11-05 17:50:48 UTC (rev 10188)
+++ configure.ac	2017-11-11 16:36:30 UTC (rev 10189)
@@ -684,7 +684,7 @@
 dnl warnings are *not* included:
 dnl
 dnl   -ansi                 Requires messing with feature test macros.
-dnl   -pedantic             Too much noise from embedded Perl.
+dnl   -Wpedantic             Too much noise from embedded Perl.
 dnl   -Wdouble-promotion    Too much noise from using printf with floats.
 dnl   -Wswitch-default      Quite annoying to enforce it.
 dnl   -Wstrict-overflow=2   Gives false positives.
@@ -693,7 +693,6 @@
 dnl                         Warns about problems when upgrading from K&R to
 dnl                         ANSI C, so these aren't interesting.
 dnl   -Wundef               We need portability code.
-dnl   -Wshadow              Names like log or index are too convenient.
 dnl   -Wunsafe-loop-optimizations
 dnl                         Too much noise.
 dnl   -Wcast-qual           Used for a while, but some casts are unavoidable.
@@ -733,8 +732,8 @@
      -Wnull-dereference -Winit-self -Wmissing-include-dirs
      -Wshift-overflow=2
      -Wsync-nand -Wmissing-format-attribute -Wduplicated-cond
-     -Wtrampolines -Wpointer-arith
-     -Wbad-function-cast -Wcast-align -Wwrite-strings
+     -Wtrampolines -Wshadow -Wpointer-arith -Wc99-c11-compat -Wc++-compat
+     -Wbad-function-cast -Wcast-align -Wwrite-strings -Wdate-time
      -Wjump-misses-init -Wstrict-prototypes
      -Wold-style-definition
      -Wmissing-prototypes -Wmissing-declarations

Modified: history/hisv6/hisv6.c
===================================================================
--- history/hisv6/hisv6.c	2017-11-05 17:50:48 UTC (rev 10188)
+++ history/hisv6/hisv6.c	2017-11-11 16:36:30 UTC (rev 10189)
@@ -1147,7 +1147,6 @@
 				 HashToText(*hash), "] in history ",
 				 hiscookie->new->histpath, NULL));
     } else {
-	struct hisv6_walkstate *hiscookie = cookie;
 	TOKEN ltoken, *t;
 
 	/* if we have a token pass it to the discrimination function */

Modified: nnrpd/group.c
===================================================================
--- nnrpd/group.c	2017-11-05 17:50:48 UTC (rev 10188)
+++ nnrpd/group.c	2017-11-11 16:36:30 UTC (rev 10189)
@@ -125,7 +125,7 @@
 	     * don't report them as we don't want them to appear too
 	     * soon. */
 	    if (innconf->nfsreader != 0) {
-		ARTNUM low, prev;
+		ARTNUM nfslow, prev;
 		time_t now, arrived;
 
 		time(&now);
@@ -132,16 +132,16 @@
                 /* We assume that during the last nfsreaderdelay seconds,
                  * we did not receive more than 1 article per second. */
 		if (ARTlow + innconf->nfsreaderdelay > ARThigh)
-		    low = ARTlow;
+		    nfslow = ARTlow;
 		else
-		    low = ARThigh - innconf->nfsreaderdelay;
-		handle = OVopensearch(group, low, ARThigh);
+		    nfslow = ARThigh - innconf->nfsreaderdelay;
+		handle = OVopensearch(group, nfslow, ARThigh);
 		if (!handle) {
 		    Reply("%d group disappeared\r\n", NNTP_FAIL_ACTION);
 		    free(group);
 		    return;
 		}
-		prev = low;
+		prev = nfslow;
 		while (OVsearch(handle, &i, NULL, NULL, NULL, &arrived)) {
 		    if ((time_t) (arrived + innconf->nfsreaderdelay) > now) {
 			ARThigh = prev;



More information about the inn-committers mailing list