[hackers] [scc] [cc1] Add the name of the field in error messages || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 12 Dec 2016 09:32:46 +0100 (CET)

commit bdfc1f31f55a9d5ed30e2b2e0995e82545984341
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Dec 12 09:31:46 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Dec 12 09:31:46 2016 +0100

    [cc1] Add the name of the field in error messages

diff --git a/cc1/decl.c b/cc1/decl.c
index 9dd0fad..437f52f 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -619,7 +619,6 @@ field(struct decl *dcl)
         TINT n = structp->n.elem;
         int err = 0;
 
- /* TODO: print name of the field in the errors */
         if (accept(':')) {
                 Node *np;
                 TINT n;
_AT_@ -644,11 +643,11 @@ field(struct decl *dcl)
         }
 
         if (tp->op == FTN) {
- errorp("invalid type in struct/union");
+ errorp("invalid type '%s' in struct/union", name);
                 err = 1;
         }
         if (dcl->sclass) {
- errorp("storage class in struct/union field");
+ errorp("storage class in struct/union field '%s'", name);
                 err = 1;
         }
         if (!(tp->prop & TDEFINED)) {
Received on Mon Dec 12 2016 - 09:32:46 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 12 2016 - 09:36:34 CET