Add default case to switches on enum variables
Missing enum members in case statements in c2xml.c and parse.c were
causing compile time complaints by gcc 5.1.1. Adding a default case
satisfies the compiler and notifies the reviewer that there are
cases not explicitly mentioned being handled by the default case.
Signed-off-by: Tony Camuso <tcamuso@redhat.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
diff --git a/c2xml.c b/c2xml.c
index 67486c7..c45d581 100644
--- a/c2xml.c
+++ b/c2xml.c
@@ -214,6 +214,8 @@
case SYM_UNINITIALIZED:
newProp(child, "base-type-builtin", builtin_typename(sym));
break;
+ default:
+ break;
}
return;
}
@@ -330,4 +332,3 @@
return 0;
}
-
diff --git a/parse.c b/parse.c
index 8afae73..4e38f3f 100644
--- a/parse.c
+++ b/parse.c
@@ -2771,6 +2771,9 @@
case SYM_ENUM:
case SYM_RESTRICT:
base_type->ident = ident;
+ break;
+ default:
+ break;
}
}
} else if (base_type && base_type->type == SYM_FN) {