INN commit: trunk (18 files)
INN Commit
rra at isc.org
Mon Jun 5 12:21:40 UTC 2017
Date: Monday, June 5, 2017 @ 05:21:39
Author: iulius
Revision: 10147
Fix new implicit-fallthrough warning in GCC 7
Indicate that some functions never return, or that fallthrough
in switch statements is expected.
Modified:
trunk/backends/actsync.c
trunk/backends/innxbatch.c
trunk/backends/innxmit.c
trunk/backends/nntpget.c
trunk/backends/shlock.c
trunk/backends/shrinkfile.c
trunk/expire/expire.c
trunk/expire/grephistory.c
trunk/expire/makedbz.c
trunk/expire/prunehistory.c
trunk/frontends/ctlinnd.c
trunk/frontends/inews.c
trunk/innd/innd.c
trunk/innfeed/host.c
trunk/innfeed/main.c
trunk/lib/hashtab.c
trunk/nnrpd/nnrpd.c
trunk/storage/ovdb/ovdb.c
-----------------------+
backends/actsync.c | 1 +
backends/innxbatch.c | 5 +++++
backends/innxmit.c | 3 +++
backends/nntpget.c | 6 ++++++
backends/shlock.c | 1 +
backends/shrinkfile.c | 2 ++
expire/expire.c | 4 +++-
expire/grephistory.c | 2 ++
expire/makedbz.c | 2 ++
expire/prunehistory.c | 1 +
frontends/ctlinnd.c | 3 +++
frontends/inews.c | 2 ++
innd/innd.c | 1 +
innfeed/host.c | 2 +-
innfeed/main.c | 2 +-
lib/hashtab.c | 14 ++++++++++++--
nnrpd/nnrpd.c | 1 +
storage/ovdb/ovdb.c | 2 ++
18 files changed, 49 insertions(+), 5 deletions(-)
Modified: backends/actsync.c
===================================================================
--- backends/actsync.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ backends/actsync.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -1019,6 +1019,7 @@
if (cur->type[1] == 'g') {
cur->type[1] = '\0';
}
+ /* fallthrough */
case NF_FLAG_MODERATED:
case NF_FLAG_JUNK:
case NF_FLAG_NOLOCAL:
Modified: backends/innxbatch.c
===================================================================
--- backends/innxbatch.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ backends/innxbatch.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -76,6 +76,11 @@
static unsigned long STATrejected;
/*
+** Prototypes.
+*/
+static void ExitWithStats(int) __attribute__ ((__noreturn__));
+
+/*
** Send a line to the server. \r\n will be appended
*/
static bool
Modified: backends/innxmit.c
===================================================================
--- backends/innxmit.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ backends/innxmit.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -148,6 +148,9 @@
*/
static ARTHANDLE *article_open(const char *path, const char *id);
static void article_free(ARTHANDLE *);
+static void Usage(void) __attribute__ ((__noreturn__));
+static void RequeueRestAndExit(char *, char *) __attribute__ ((__noreturn__));
+static void ExitWithStats(int) __attribute__ ((__noreturn__));
/*
Modified: backends/nntpget.c
===================================================================
--- backends/nntpget.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ backends/nntpget.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -55,7 +55,13 @@
static struct history *History;
+/*
+** Prototypes.
+*/
+static void Usage(const char *) __attribute__ ((__noreturn__));
+
+
/*
** Read a line of input, with timeout.
*/
Modified: backends/shlock.c
===================================================================
--- backends/shlock.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ backends/shlock.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -18,6 +18,7 @@
static bool BinaryLock;
static bool JustChecking;
+static void Usage(void) __attribute__ ((__noreturn__));
#define CANTUNLINK "shlock: Can't unlink \"%s\", %s"
#define CANTOPEN "shlock: Can't open \"%s\", %s"
Modified: backends/shrinkfile.c
===================================================================
--- backends/shrinkfile.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ backends/shrinkfile.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -36,7 +36,9 @@
#define MAX_SIZE 0x7fffffffUL
+static void Usage(void) __attribute__ ((__noreturn__));
+
/*
** Open a safe unique temporary file that will go away when closed.
*/
Modified: expire/expire.c
===================================================================
--- expire/expire.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ expire/expire.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -54,7 +54,9 @@
static struct history *History;
static char *NHistory;
-static void CleanupAndExit(bool Server, bool Paused, int x);
+static void CleanupAndExit(bool Server, bool Paused, int x)
+ __attribute__ ((__noreturn__));
+static void Usage(void) __attribute__ ((__noreturn__));
static int EXPsplit(char *p, char sep, char **argv, int count);
Modified: expire/grephistory.c
===================================================================
--- expire/grephistory.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ expire/grephistory.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -14,6 +14,8 @@
#include "inn/paths.h"
#include "inn/storage.h"
+static void Usage(void) __attribute__ ((__noreturn__));
+
/*
** Read stdin for list of Message-ID's, output list of ones we
** don't have. Or, output list of files for ones we DO have.
Modified: expire/makedbz.c
===================================================================
--- expire/makedbz.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ expire/makedbz.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -26,6 +26,8 @@
char *HistoryDir = NULL;
char *HISTORY = NULL;
+static void Usage(void) __attribute__ ((__noreturn__));
+
/*
** Remove the DBZ files for the specified base text file.
*/
Modified: expire/prunehistory.c
===================================================================
--- expire/prunehistory.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ expire/prunehistory.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -14,6 +14,7 @@
#include "inn/libinn.h"
#include "inn/paths.h"
+static void Usage(void) __attribute__ ((__noreturn__));
/*
** Print usage message and exit.
Modified: frontends/ctlinnd.c
===================================================================
--- frontends/ctlinnd.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ frontends/ctlinnd.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -112,7 +112,10 @@
};
+static void Usage(const char *) __attribute__ ((__noreturn__));
+static void WrongArgs(COMMAND *) __attribute__ ((__noreturn__));
+
/*
** Print a help summary.
*/
Modified: frontends/inews.c
===================================================================
--- frontends/inews.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ frontends/inews.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -64,6 +64,8 @@
BAD_DISTRIBS
};
+static void Usage(void) __attribute__ ((__noreturn__));
+
static HEADER Table[] = {
/* Name Canset Type */
{ "Path", true, HTstd, 0, NULL },
Modified: innd/innd.c
===================================================================
--- innd/innd.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ innd/innd.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -61,6 +61,7 @@
static void catch_terminate(int sig);
static void xmalloc_abort(const char *what, size_t size,
const char *file, int line);
+static void Usage(void) __attribute__ ((__noreturn__));
/* header table initialization */
#define ARTHEADERINIT(name, type) {name, type, sizeof(name) - 1}
Modified: innfeed/host.c
===================================================================
--- innfeed/host.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ innfeed/host.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -1634,7 +1634,7 @@
* and concentrate on queue sizes
*/
ratio = percentTaken * percentTaken;
- /* nobreak; */
+ /* fallthrough */
case METHOD_QUEUE:
/* backlogFilter is an IIR filtered version of the backlogRatio.
*/
Modified: innfeed/main.c
===================================================================
--- innfeed/main.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ innfeed/main.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -93,7 +93,7 @@
static void sighup (int sig) ;
static void sigterm (int sig) ;
static void sigusr (int sig) ;
-static void usage (int) ;
+static void usage (int) __attribute__ ((__noreturn__)) ;
static void gprintinfo (void) ;
static void openLogFile (void) ;
static void writePidFile (void) ;
Modified: lib/hashtab.c
===================================================================
--- lib/hashtab.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ lib/hashtab.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -431,18 +431,28 @@
c += length;
switch (len) {
case 11: c += S3(key[10]);
+ /* fallthrough */
case 10: c += S2(key[9]);
+ /* fallthrough */
case 9: c += S1(key[8]);
- /* The first byte of c is reserved for the length. */
+ /* The first byte of c is reserved for the length. */
+ /* fallthrough */
case 8: b += S3(key[7]);
+ /* fallthrough */
case 7: b += S2(key[6]);
+ /* fallthrough */
case 6: b += S1(key[5]);
+ /* fallthrough */
case 5: b += S0(key[4]);
+ /* fallthrough */
case 4: a += S3(key[3]);
+ /* fallthrough */
case 3: a += S2(key[2]);
+ /* fallthrough */
case 2: a += S1(key[1]);
+ /* fallthrough */
case 1: a += S0(key[0]);
- /* case 0: nothing left to add. */
+ /* case 0: nothing left to add. */
}
MIX(a, b, c);
return c;
Modified: nnrpd/nnrpd.c
===================================================================
--- nnrpd/nnrpd.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ nnrpd/nnrpd.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -43,6 +43,7 @@
bool encryption_layer_on = false;
#endif
+static void Usage(void) __attribute__ ((__noreturn__));
/*
** If we have getloadavg, include the appropriate header file. Otherwise,
Modified: storage/ovdb/ovdb.c
===================================================================
--- storage/ovdb/ovdb.c 2017-06-03 14:16:58 UTC (rev 10146)
+++ storage/ovdb/ovdb.c 2017-06-05 12:21:39 UTC (rev 10147)
@@ -938,6 +938,7 @@
break;
default:
warn("OVDB: mk_temp_groupinfo: groupinfo->put: %s", db_strerror(ret));
+ /* fallthrough */
case TRYAGAIN:
return ret;
}
@@ -2606,6 +2607,7 @@
default:
warn("OVDB: expiregroup: ovdb_getgroupinfo failed: %s",
db_strerror(ret));
+ /* fallthrough */
case DB_NOTFOUND:
TXN_ABORT(t_expgroup_1, tid);
return false;
More information about the inn-committers
mailing list