Commit 0468bc75 by Richard Kenner

(check_newline): Give warning if unrecognized data on #line.

(yylex): Give error for unterminated string constant.

From-SVN: r8976
parent 18736654
/* Lexical analyzer for C and Objective C.
Copyright (C) 1987, 1988, 1989, 1992, 1994 Free Software Foundation, Inc.
Copyright (C) 1987, 88, 89, 92, 94, 1995 Free Software Foundation, Inc.
This file is part of GNU CC.
......@@ -644,7 +644,20 @@ linenum:
if (token == CONSTANT
&& TREE_CODE (yylval.ttype) == INTEGER_CST
&& TREE_INT_CST_LOW (yylval.ttype) == 3)
in_system_header = 1;
in_system_header = 1, used_up = 1;
if (used_up)
{
/* Is this the last nonwhite stuff on the line? */
c = getc (finput);
while (c == ' ' || c == '\t')
c = getc (finput);
if (c == '\n')
return c;
ungetc (c, finput);
}
warning ("unrecognized text at end of #line");
}
else
error ("invalid #-line");
......@@ -1798,6 +1811,9 @@ yylex ()
}
*p = 0;
if (c < 0)
error ("Unterminated string constant");
/* We have read the entire constant.
Construct a STRING_CST for the result. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment