aboutsummaryrefslogtreecommitdiffstats
path: root/src/cJSON.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-12-17 15:47:06 +0000
committerWerner Koch <[email protected]>2018-12-17 15:47:27 +0000
commit8b41fb08f00f01fe0dd8b2b5455d3422d97ddc60 (patch)
treef3c215ce09bc0a8ead706238b5e95931434d0a24 /src/cJSON.c
parentpython: howto and examples (diff)
downloadgpgme-8b41fb08f00f01fe0dd8b2b5455d3422d97ddc60.tar.gz
gpgme-8b41fb08f00f01fe0dd8b2b5455d3422d97ddc60.zip
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 <[email protected]>
Diffstat (limited to 'src/cJSON.c')
-rw-r--r--src/cJSON.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cJSON.c b/src/cJSON.c
index 9e53012e..64a54c72 100644
--- a/src/cJSON.c
+++ b/src/cJSON.c
@@ -352,12 +352,15 @@ parse_string (cJSON * item, const char *str, const char **ep)
case 4:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
+ /*FALLTHRU*/
case 3:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
+ /*FALLTHRU*/
case 2:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
+ /*FALLTHRU*/
case 1:
*--ptr2 = (uc | firstByteMark[len]);
}