diff --git a/src/bip.c b/src/bip.c index 1871aed..34584d4 100644 --- a/src/bip.c +++ b/src/bip.c @@ -82,7 +82,12 @@ static void hash_binary(char *hex, unsigned char **password, unsigned int *seed) md5 = bip_malloc((size_t) 20); for (i = 0; i < 20; i++) { sscanf(hex + 2 * i, "%02x", &buf); +// conversion from ‘unsigned int’ to ‘unsigned char’ may change value +// we're parsing a text (hex) so buf won't ever be something else than a char +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" md5[i] = buf; +#pragma GCC diagnostic pop } *seed = 0; diff --git a/src/irc.c b/src/irc.c index a4cee2e..3729271 100644 --- a/src/irc.c +++ b/src/irc.c @@ -24,6 +24,9 @@ #include "md5.h" #include "utils/base64.h" +// TODO resolve assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 +#pragma GCC diagnostic ignored "-Wstrict-overflow" + #define S_CONN_DELAY (10) extern int sighup; diff --git a/src/line.c b/src/line.c index ff07743..dd79eb7 100644 --- a/src/line.c +++ b/src/line.c @@ -16,6 +16,9 @@ #include "line.h" #include "util.h" +// TODO resolve assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 +#pragma GCC diagnostic ignored "-Wstrict-overflow" + void irc_line_init(struct line *l) { memset(l, 0, sizeof(struct line)); diff --git a/src/md5.c b/src/md5.c index e408157..03d0985 100644 --- a/src/md5.c +++ b/src/md5.c @@ -360,7 +360,11 @@ unsigned char *chash_double(char *str, unsigned int seed) length = strlen(str); length += 4; ptr = bip_malloc(length); +// conversion from ‘unsigned int’ to ‘unsigned char’ may change value [-Werror=conversion] +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" ptr[0] = seed >> 24 & 0xff; +#pragma GCC diagnostic pop ptr[1] = seed >> 16 & 0xff; ptr[2] = seed >> 8 & 0xff; ptr[3] = seed & 0xff; diff --git a/src/util.h b/src/util.h index bb84710..41d3cc5 100644 --- a/src/util.h +++ b/src/util.h @@ -43,11 +43,14 @@ struct list_item { void *ptr; }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-prototypes" typedef struct list { struct list_item *first; struct list_item *last; int (*cmp)(); } list_t; +#pragma GCC diagnostic pop typedef struct list_iterator { list_t *list;