[PATCH 3/3] enum: more specific error message for empty enum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently, the error message issued for an empty enum is
"bad enum definition". This is exactly the same message
used when one of the enumerator is invalid.

Fix this by using a specific error message.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 parse.c                   | 2 +-
 validation/enum-invalid.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/parse.c b/parse.c
index 1886495f8..d4886c41c 100644
--- a/parse.c
+++ b/parse.c
@@ -972,7 +972,7 @@ static struct token *parse_enum_declaration(struct token *token, struct symbol *
 		token = token->next;
 	}
 	if (!base_type) {
-		sparse_error(token->pos, "bad enum definition");
+		sparse_error(token->pos, "empty enum definition");
 		base_type = &bad_ctype;
 	}
 	else if (!is_int_type(base_type))
diff --git a/validation/enum-invalid.c b/validation/enum-invalid.c
index 08846442d..62f8864d4 100644
--- a/validation/enum-invalid.c
+++ b/validation/enum-invalid.c
@@ -5,7 +5,7 @@ enum f { F = 0.1 };
  * check-name: enum-invalid
  *
  * check-error-start
-enum-invalid.c:1:10: error: bad enum definition
+enum-invalid.c:1:10: error: empty enum definition
 enum-invalid.c:2:14: error: bad constant expression
  * check-error-end
  */
-- 
2.19.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux