From baf69f3725f8eef6a7a34ef4c94264f7daecb9f5 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Thu, 22 Nov 2012 20:32:08 +0000 Subject: [PATCH] Fix more warnings --- Makefile | 2 -- ftepp.c | 2 +- ir.c | 2 +- main.c | 2 +- util.c | 4 ++-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 94b8b0b..727f68c 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,6 @@ ifeq ($(CC), clang) -Weverything \ -Wno-missing-prototypes \ -Wno-unused-parameter \ - -Wno-sign-compare \ - -Wno-implicit-fallthrough \ -Wno-sign-conversion \ -Wno-conversion \ -Wno-disabled-macro-expansion \ diff --git a/ftepp.c b/ftepp.c index 1d73430..e677e74 100644 --- a/ftepp.c +++ b/ftepp.c @@ -1115,7 +1115,7 @@ static bool ftepp_hash(ftepp_t *ftepp) ftepp_error(ftepp, "unrecognized preprocessor directive: `%s`", ftepp_tokval(ftepp)); return false; } - break; + /* break; never reached */ default: ftepp_error(ftepp, "unexpected preprocessor token: `%s`", ftepp_tokval(ftepp)); return false; diff --git a/ir.c b/ir.c index a8d54f0..f4910fe 100644 --- a/ir.c +++ b/ir.c @@ -3167,7 +3167,7 @@ bool ir_builder_generate(ir_builder *self, const char *filename) const char *qc_opname(int op) { if (op < 0) return ""; - if (op < ( sizeof(asm_instr) / sizeof(asm_instr[0]) )) + if (op < (int)( sizeof(asm_instr) / sizeof(asm_instr[0]) )) return asm_instr[op].m; switch (op) { case VINSTR_PHI: return "PHI"; diff --git a/main.c b/main.c index 3ebbcc9..ce09f35 100644 --- a/main.c +++ b/main.c @@ -256,7 +256,7 @@ static bool options_parse(int argc, char **argv) { case 'h': usage(); exit(0); - break; + /* break; never reached because of exit(0) */ case 'E': opts_pp_only = true; diff --git a/util.c b/util.c index a900889..8b54251 100644 --- a/util.c +++ b/util.c @@ -270,8 +270,8 @@ void util_endianswap(void *m, int s, int l) { if(*((char *)&s)) return; - for(; w < l; w++) { - for(; i < s << 1; i++) { + for(; w < (size_t)l; w++) { + for(; i < (size_t)(s << 1); i++) { unsigned char *p = (unsigned char *)m+w*s; unsigned char t = p[i]; p[i] = p[s-i-1]; -- 2.39.2