From 634dd71384e6dfb6ce765484fb47628c987d1c55 Mon Sep 17 00:00:00 2001 From: jsteube Date: Mon, 6 Aug 2018 21:04:48 +0200 Subject: [PATCH] Remove some suppressed warnings --- src/Makefile | 11 ----------- src/interface.c | 30 +++++++++++++++--------------- src/rp_cpu.c | 2 +- src/shared.c | 2 +- 4 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/Makefile b/src/Makefile index 2fb20a4e8..5cbb14636 100644 --- a/src/Makefile +++ b/src/Makefile @@ -171,17 +171,6 @@ CFLAGS += -Werror-implicit-function-declaration CFLAGS += -Wformat CFLAGS += -ftrapv CFLAGS += -Wwrite-strings - -# the following compiler options produce warnings that should be fixed at some time - -CFLAGS += -Wno-cast-align -CFLAGS += -Wno-cast-qual -CFLAGS += -Wno-conversion -CFLAGS += -Wno-padded -CFLAGS += -Wno-pedantic -CFLAGS += -Wno-sizeof-pointer-memaccess -#CFLAGS += -Wno-reserved-id-macro //clang specific -#CFLAGS += -Wno-used-but-marked-unused // ^^ endif # default Linux and freebsd thread stack size is 2MB diff --git a/src/interface.c b/src/interface.c index f504e1a5c..4d1e68876 100644 --- a/src/interface.c +++ b/src/interface.c @@ -6739,9 +6739,9 @@ int truecrypt_parse_hash_1k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAY if (fp == NULL) return (PARSER_HASH_FILE); - char buf[512] = { 0 }; + u8 buf[512]; - const size_t n = hc_fread (buf, 1, sizeof (buf), fp); + const size_t n = hc_fread ((char *) buf, 1, sizeof (buf), fp); fclose (fp); @@ -6782,9 +6782,9 @@ int truecrypt_parse_hash_2k (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAY if (fp == NULL) return (PARSER_HASH_FILE); - char buf[512] = { 0 }; + u8 buf[512]; - const size_t n = hc_fread (buf, 1, sizeof (buf), fp); + const size_t n = hc_fread ((char *) buf, 1, sizeof (buf), fp); fclose (fp); @@ -6825,9 +6825,9 @@ int veracrypt_parse_hash_200000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, if (fp == NULL) return (PARSER_HASH_FILE); - char buf[512] = { 0 }; + u8 buf[512]; - const size_t n = hc_fread (buf, 1, sizeof (buf), fp); + const size_t n = hc_fread ((char *) buf, 1, sizeof (buf), fp); fclose (fp); @@ -6868,9 +6868,9 @@ int veracrypt_parse_hash_500000 (u8 *input_buf, u32 input_len, hash_t *hash_buf, if (fp == NULL) return (PARSER_HASH_FILE); - char buf[512] = { 0 }; + u8 buf[512]; - const size_t n = hc_fread (buf, 1, sizeof (buf), fp); + const size_t n = hc_fread ((char *) buf, 1, sizeof (buf), fp); fclose (fp); @@ -6911,9 +6911,9 @@ int veracrypt_parse_hash_327661 (u8 *input_buf, u32 input_len, hash_t *hash_buf, if (fp == NULL) return (PARSER_HASH_FILE); - char buf[512] = { 0 }; + u8 buf[512]; - const size_t n = hc_fread (buf, 1, sizeof (buf), fp); + const size_t n = hc_fread ((char *) buf, 1, sizeof (buf), fp); fclose (fp); @@ -6954,9 +6954,9 @@ int veracrypt_parse_hash_655331 (u8 *input_buf, u32 input_len, hash_t *hash_buf, if (fp == NULL) return (PARSER_HASH_FILE); - char buf[512] = { 0 }; + u8 buf[512]; - const size_t n = hc_fread (buf, 1, sizeof (buf), fp); + const size_t n = hc_fread ((char *) buf, 1, sizeof (buf), fp); fclose (fp); @@ -12650,7 +12650,7 @@ int sip_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U * first (pre-)compute: HA2 = md5 ($method . ":" . $uri) */ - char *pcsep = (char *) ":"; + static u8 *pcsep = (u8 *) ":"; int md5_len = method_len + 1 + URI_prefix_len + URI_resource_len + URI_suffix_len; @@ -12787,9 +12787,9 @@ int sip_auth_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U // tmp_digest - char tmp[64]; + u8 tmp[64]; - snprintf (tmp, sizeof (tmp) - 1, "%08x%08x%08x%08x", + snprintf ((char *) tmp, sizeof (tmp) - 1, "%08x%08x%08x%08x", tmp_digest[0], tmp_digest[1], tmp_digest[2], diff --git a/src/rp_cpu.c b/src/rp_cpu.c index 45f587375..9e6cfbf53 100644 --- a/src/rp_cpu.c +++ b/src/rp_cpu.c @@ -502,7 +502,7 @@ int _old_apply_rule (const char *rule, int rule_len, char in[RP_PASSWORD_SIZE], { if (is_hex_notation (rule, rule_len, rule_pos)) { - const u8 c = hex_to_u8 (&rule[rule_pos + 2]); + const u8 c = hex_to_u8 ((const u8 *) &rule[rule_pos + 2]); rule_pos += 3; diff --git a/src/shared.c b/src/shared.c index 9840422d2..16e5e68e1 100644 --- a/src/shared.c +++ b/src/shared.c @@ -667,7 +667,7 @@ u64 round_up_multiple_64 (const u64 v, const u64 m) void hc_strncat (u8 *dst, u8 *src, const size_t n) { - const size_t dst_len = strlen (dst); + const size_t dst_len = strlen ((char *) dst); u8 *src_ptr = src; u8 *dst_ptr = dst + dst_len;