scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit bdfc1f31f55a9d5ed30e2b2e0995e82545984341
parent 1915e51243e12bb5a4037d8458d53c0cc32f160e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 12 Dec 2016 09:31:46 +0100

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

Diffstat:
Mcc1/decl.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -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; @@ -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)) {