diff mbox

[2/3,v3] Add default case to switches on enum variables

Message ID 1439210132-19384-1-git-send-email-tcamuso@redhat.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Tony Camuso Aug. 10, 2015, 12:35 p.m. UTC
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>

---
 c2xml.c | 3 ++-
 parse.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/c2xml.c b/c2xml.c
index 67486c7..c45d581 100644
--- a/c2xml.c
+++ b/c2xml.c
@@ -214,6 +214,8 @@  static void examine_symbol(struct symbol *sym, xmlNodePtr node)
 	case SYM_UNINITIALIZED:
 		newProp(child, "base-type-builtin", builtin_typename(sym));
 		break;
+	default:
+		break;
 	}
 	return;
 }
@@ -330,4 +332,3 @@  int main(int argc, char **argv)
 
 	return 0;
 }
-
diff --git a/parse.c b/parse.c
index b43d683..39308da 100644
--- a/parse.c
+++ b/parse.c
@@ -2769,6 +2769,8 @@  struct token *external_declaration(struct token *token, struct symbol_list **lis
 			case SYM_ENUM:
 			case SYM_RESTRICT:
 				base_type->ident = ident;
+			default:
+				break;
 			}
 		}
 	} else if (base_type && base_type->type == SYM_FN) {