# HG changeset patch # User Michael Pavone # Date 1435432638 25200 # Node ID 7306b3967c513fc99bc8d9479355450917e2ea54 # Parent cfa402c6ced84e4a3442e4bbd4ba26d50d26c624 Cleanup some warnings under clang through a combination of code fixes and supressing specific warnings diff -r cfa402c6ced8 -r 7306b3967c51 Makefile --- a/Makefile Sat Jun 27 11:39:55 2015 -0700 +++ b/Makefile Sat Jun 27 12:17:18 2015 -0700 @@ -25,10 +25,10 @@ endif #Darwin ifdef DEBUG -CFLAGS:=-ggdb -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration +CFLAGS:=-ggdb -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value -Wno-logical-op-parentheses LDFLAGS:=-ggdb -lm $(shell pkg-config --libs $(LIBS)) else -CFLAGS:=-O2 -flto -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration +CFLAGS:=-O2 -flto -std=gnu99 $(shell pkg-config --cflags-only-I $(LIBS)) -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value -Wno-logical-op-parentheses LDFLAGS:=-O2 -flto -lm $(shell pkg-config --libs $(LIBS)) endif #DEBUG endif #Windows diff -r cfa402c6ced8 -r 7306b3967c51 gen_x86.c --- a/gen_x86.c Sat Jun 27 11:39:55 2015 -0700 +++ b/gen_x86.c Sat Jun 27 12:17:18 2015 -0700 @@ -2018,7 +2018,7 @@ disp >>= 8; *(out++) = disp; } else { - mov_ir(code, fun, RAX, SZ_PTR); + mov_ir(code, (int64_t)fun, RAX, SZ_PTR); call_r(code, RAX); } code->cur = out; @@ -2228,7 +2228,7 @@ if (*code & REX_QUAD) { op_size = SZ_Q; } - } else if(*code == PRE_2BYTE || PRE_XOP) { + } else if(*code == PRE_2BYTE || *code == PRE_XOP) { prefix = *code; } else { main_op = *code; diff -r cfa402c6ced8 -r 7306b3967c51 z80_to_x86.c --- a/z80_to_x86.c Sat Jun 27 11:39:55 2015 -0700 +++ b/z80_to_x86.c Sat Jun 27 12:17:18 2015 -0700 @@ -1951,7 +1951,7 @@ uint8_t * z80_interp_handler(uint8_t opcode, z80_context * context) { if (!context->interp_code[opcode]) { - if (opcode == 0xCB || (opcode >= 0xDD && opcode & 0xF == 0xD)) { + if (opcode == 0xCB || (opcode >= 0xDD && (opcode & 0xF) == 0xD)) { fprintf(stderr, "Encountered prefix byte %X at address %X. Z80 interpeter doesn't support those yet.", opcode, context->pc); exit(1); }