scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 8114daf5316665872ab2d299d0de0c53d68142af
parent 7b107499b1940756a5cf8633c3813d1246fd6e22
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Fri, 10 Apr 2026 23:15:43 +0200

cc1: Be more strict about invalid escape sequences

When there are invalid hexa and universal constants we must
emit en error diagnosis and not only one a warning.

Diffstat:
Msrc/cmd/scc-cc/cc1/lex.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/cmd/scc-cc/cc1/lex.c b/src/cmd/scc-cc/cc1/lex.c @@ -598,10 +598,10 @@ escape(int multi) if (base == 16 && i != cnt) { if (uni) { - warn("incorrect digit for universal character constant"); + errorp("incorrect digit for universal character constant"); c = REPLACECHAR; } else { - warn("\\x used with no following hex digits"); + errorp("\\x used with no following hex digits"); c = ' '; } } @@ -612,7 +612,7 @@ escape(int multi) if (c < 0xa0 && (c == 0x24 || c == 0x40 || c == 0x60) || c >= 0xD800 && c <= 0xDFFF || c >= 0x110000) { - warn("invalid universal character constant"); + errorp("invalid universal character constant"); c = REPLACECHAR; }