diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2002-11-29 22:41:04 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2002-11-29 22:41:04 +0000 |
commit | 2402645b4d554a5dc8f61fb88d33d716c7198c61 (patch) | |
tree | 8f162b660efca2f0a954c74272152cd23549444a /gcc/cpplib.c | |
parent | f6a83eb0a77977814adcb11f74141b0ff175a52f (diff) | |
download | gcc-2402645b4d554a5dc8f61fb88d33d716c7198c61.zip gcc-2402645b4d554a5dc8f61fb88d33d716c7198c61.tar.gz gcc-2402645b4d554a5dc8f61fb88d33d716c7198c61.tar.bz2 |
cpplib.c (_cpp_test_assertion): Default *value to 0.
* cpplib.c (_cpp_test_assertion): Default *value to 0.
* cppexp.c (num_part_mul): Initialize result.unsignedp, to 1.
From-SVN: r59648
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 7 |
1 files changed, 6 insertions, 1 deletions
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)); |