From 4a4eab4f0a5445b9cb977d2e3da70d7c512a3e64 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 24 Dec 2018 00:18:11 +0100 Subject: Add -Wall -Wextra -Werror -Ofast --- Makefile | 1 + sjit_c.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4cbd9d9..ae85740 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CLM:=clm CLMFLAGS:=-IL Platform -nr -nt +override CFLAGS:=-Wall -Wextra -Werror -Ofast $(CFLAGS) BIN:=sjit diff --git a/sjit_c.c b/sjit_c.c index 85702fc..54c43dc 100644 --- a/sjit_c.c +++ b/sjit_c.c @@ -20,7 +20,7 @@ enum instr { IDivRet }; -static uint32_t instr_size(enum instr instr) { +static inline uint32_t instr_size(enum instr instr) { switch (instr) { case PushRef: return 5+1; case PushI: return 7+1; @@ -35,6 +35,10 @@ static uint32_t instr_size(enum instr instr) { case ISubRet: return 5+5+3+5+1; case IMulRet: return 5+5+4+5+1; case IDivRet: return 5+5+3+3+5+1; + + default: + fprintf(stderr,"unknown instruction %d\n",instr); + exit(1); } } @@ -169,7 +173,7 @@ static inline void gen_instr(char *full_code, char **code_p, uint64_t **pgm_p, u break; default: - fprintf(stderr,"unknown instruction %lu\n",pgm[-1]); + fprintf(stderr,"unknown instruction %d\n",(int)pgm[-1]); exit(1); } -- cgit v1.2.3