scc

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

commit 929f5e2ff45a91d85948ecd5583c0ff90958c218
parent eede1482b3b6450105ed2a24d4c71db47c43b9d0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 27 May 2015 00:28:02 +0200

Give better message errors in preprocessor

Diffstat:
Mcc1/cpp.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -515,7 +515,7 @@ elseclause(char *s) struct ifstatus *ip; if (cppctx == 0) - error("#else without #if"); + error("#else without #ifdef/ifndef"); cleanup(s); cppoff += (ifstatus[cppctx-1] ^= 1) ? -1 : 1; } @@ -526,7 +526,7 @@ undef(char *s) Symbol *sym; if (!iden(&s)) - error("#undef must have an identifier as parameter"); + error("no macro name given in #undef directive"); sym = lookup(NS_CPP); sym->flags &= ~ISDEFINED; cleanup(s);