From 8b41fb08f00f01fe0dd8b2b5455d3422d97ddc60 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 17 Dec 2018 16:47:06 +0100 Subject: core: Silence newer compiler warnings. * configure.ac: Add -Wno-format-truncation and -Wno-sizeof-pointer-div. * src/b64dec.c (_gpgme_b64dec_proc): Add fallthrough annotation. * src/cJSON.c (parse_string): Ditto. * src/gpgme-json.c (main): Ditto. -- gcc 8 enables a couple of new warnings. Some of them are useless for us. In particular: util.h:42:26: warning: division 'sizeof (char *) / sizeof (char)' does not compute the number of array elements [-Wsizeof-pointer-div] #define DIM(v) (sizeof(v)/sizeof((v)[0])) ^ trustlist.c:101:22: note: in expansion of macro 'DIM' if (strlen (p) == DIM(item->keyid) - 1) Which is a real standard way to use DIM, here the right hand side is equivalent to sizeof but nevertheless it is correct. Yes sir, we know C. The format string warnings I have seen were assuming that the time structure returns valued out of scope - but if the system is that broken, the s_n_printf catches this. Signed-off-by: Werner Koch --- src/b64dec.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/b64dec.c') diff --git a/src/b64dec.c b/src/b64dec.c index 1b845ee4..66ab2ec7 100644 --- a/src/b64dec.c +++ b/src/b64dec.c @@ -118,6 +118,7 @@ _gpgme_b64dec_proc (struct b64state *state, void *buffer, size_t length, break; case s_init: ds = s_lfseen; + /*FALLTHRU*/ case s_lfseen: if (*s != "-----BEGIN "[pos]) { -- cgit v1.2.3