diff mbox

[1/3] fix show typename of enums

Message ID 20180418153959.33271-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Luc Van Oostenryck April 18, 2018, 3:39 p.m. UTC
Currently when displaying the typename of an enum this
typename is first prefixed with the enum base type (most
often 'int'). So displaying the type for 'enum num' will
give 'int enum num'. This is a bit weird, we expect to have
just the type which is 'enum num'.

Change this by stopping to display the base type.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 show-parse.c               | 2 +-
 validation/enum-mismatch.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/show-parse.c b/show-parse.c
index 72d3f3854..ccd60a26e 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -342,7 +342,7 @@  deeper:
 
 	case SYM_ENUM:
 		prepend(name, "enum %s ", show_ident(sym->ident));
-		break;
+		goto out;
 
 	case SYM_NODE:
 		append(name, "%s", show_ident(sym->ident));
diff --git a/validation/enum-mismatch.c b/validation/enum-mismatch.c
index 9a929d24c..9d61f5816 100644
--- a/validation/enum-mismatch.c
+++ b/validation/enum-mismatch.c
@@ -13,7 +13,7 @@  static enum eb foo(enum ea a)
  *
  * check-error-start
 enum-mismatch.c:7:16: warning: mixing different enum types
-enum-mismatch.c:7:16:     int enum ea  versus
-enum-mismatch.c:7:16:     int enum eb 
+enum-mismatch.c:7:16:     enum ea  versus
+enum-mismatch.c:7:16:     enum eb 
  * check-error-end
  */