From 9fd28e01739f4481d4c81b3d721dd61d48f324a6 Mon Sep 17 00:00:00 2001 From: hp Date: Fri, 29 Nov 2002 22:41:04 +0000 Subject: [PATCH] * cpplib.c (_cpp_test_assertion): Default *value to 0. * cppexp.c (num_part_mul): Initialize result.unsignedp, to 1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59648 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/cppexp.c | 1 + gcc/cpplib.c | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 409703d..dc5a79a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-11-29 Hans-Peter Nilsson + + * cpplib.c (_cpp_test_assertion): Default *value to 0. + + * cppexp.c (num_part_mul): Initialize result.unsignedp, to 1. + 2002-11-29 Ulrich Weigand * config/s390/t-crtstuff: New target makefile fragment. diff --git a/gcc/cppexp.c b/gcc/cppexp.c index d4ea2fc..7f576f2 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -1446,6 +1446,7 @@ num_part_mul (lhs, rhs) result.high += HIGH_PART (middle[0]); result.high += HIGH_PART (middle[1]); + result.unsignedp = 1; return result; } diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 7092cc0..f8a702d8 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -1689,7 +1689,7 @@ find_answer (node, candidate) /* Test an assertion within a preprocessor conditional. Returns nonzero on failure, zero on success. On success, the result of - the test is written into VALUE. */ + the test is written into VALUE, otherwise the value 0. */ int _cpp_test_assertion (pfile, value) cpp_reader *pfile; @@ -1699,6 +1699,11 @@ _cpp_test_assertion (pfile, value) cpp_hashnode *node; node = parse_assertion (pfile, &answer, T_IF); + + /* For recovery, an erroneous assertion expression is handled as a + failing assertion. */ + *value = 0; + if (node) *value = (node->type == NT_ASSERTION && (answer == 0 || *find_answer (node, answer) != 0)); -- 2.7.4