From ab411cc298badb753cba8ad91cebb662973ec59c Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 19 Jan 2014 00:32:43 -0800 Subject: [PATCH] gcc complains that he can't assure if switch-enum is complete --- include/picrin/value.h | 2 ++ src/codegen.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/picrin/value.h b/include/picrin/value.h index 12fb2a87..6f1d8fb4 100644 --- a/include/picrin/value.h +++ b/include/picrin/value.h @@ -199,6 +199,8 @@ pic_type(pic_value v) return PIC_TT_EOF; case PIC_VTYPE_HEAP: return ((struct pic_object *)pic_ptr(v))->tt; + default: + return -1; /* logic flaw */ } } diff --git a/src/codegen.c b/src/codegen.c index d70906d3..86b292fd 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -554,6 +554,7 @@ analyze_node(analyze_state *state, pic_value obj, bool tailpos) case PIC_TT_IREP: pic_error(pic, "invalid expression given"); } + pic_abort(pic, "logic flaw"); } static pic_value