diff mbox

[2/3] c2xml.c, parse.c: gcc 5+ stricter case statement parsing

Message ID 1438216001-8862-3-git-send-email-tcamuso@redhat.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Tony Camuso July 30, 2015, 12:26 a.m. UTC
The gcc 5+ compiler complains if case statements do not use all the
possible values of the switch variable. Just forces the coder to use
"default" in their case statements.

Signed-off-by: Tony Camuso <tcamuso@redhat.com>
---
 c2xml.c | 2 +-
 parse.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/c2xml.c b/c2xml.c
index 67486c7..96657d5 100644
--- a/c2xml.c
+++ b/c2xml.c
@@ -214,6 +214,7 @@  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 +331,3 @@  int main(int argc, char **argv)
 
 	return 0;
 }
-
diff --git a/parse.c b/parse.c
index b43d683..02275d8 100644
--- a/parse.c
+++ b/parse.c
@@ -2769,6 +2769,7 @@  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) {