cpptrad.c (skip_whitespace): Pass pointer to prior char.

* cpptrad.c (skip_whitespace): Pass pointer to prior char.
testsuite:
	* gcc.dg/cpp/trad/escaped-nl.c: New test.

From-SVN: r55135
This commit is contained in:
Neil Booth 2002-07-01 12:51:10 +00:00 committed by Neil Booth
parent 590e1987d2
commit e34cabb3b7
4 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2002-07-01 Neil Booth <neil@daikokuya.co.uk>
* cpptrad.c (skip_whitespace): Pass pointer to prior char.
2002-07-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* mips.h (FUNCTION_ARG_REGNO_P): Fix parentheses.

View File

@ -284,7 +284,7 @@ skip_whitespace (pfile, cur, skip_comments)
out--;
if (c == '\\' && is_vspace (*cur))
{
cur = skip_escaped_newlines (pfile, cur);
cur = skip_escaped_newlines (pfile, cur - 1);
continue;
}

View File

@ -1,3 +1,7 @@
2002-07-01 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/trad/escaped-nl.c: New test.
2002-06-30 Devang Patel <dpatel@apple.com>
* objc.dg/fsyntax-only.m: New test.

View File

@ -0,0 +1,10 @@
/* Test escaped newlines at start of macro definition are properly
skipped (buglet in skip_whitespace () in cpptrad.c). */
/* { dg-do preprocess } */
#define NUM \
100
#if NUM != 100
# error NUM not defined properly /* { dg-bogus "error" } */
#endif