scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 18ab3f16b5df956072ca9de86967136e5dbdc330
parent c12bae156bbb7ea12f7b9370d5a3e661a2a35645
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 23 Jun 2016 08:51:56 +0200

[cc1] Simplify comment()

Diffstat:
cc1/lex.c | 14+++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/cc1/lex.c b/cc1/lex.c @@ -166,18 +166,14 @@ comment(int type) c = -1; repeat: do { - if (!c) - goto unterminated; - } while (!eof && (c = readchar()) != type); + if (!c || eof) { + errorp("unterminated comment"); + return; + } + } while ((c = readchar()) != type); - if (eof) - goto unterminated; if (type == '*' && (c = readchar()) != '/') goto repeat; - return; - -unterminated: - errorp("unterminated comment"); } static int