gcc -E -traditional broken
Neil Booth
neil@daikokuya.demon.co.uk
Mon Dec 11 11:38:00 GMT 2000
Zack Weinberg wrote:-
> No, it's an oversight.
God, tracking this down is a nightmare. tradcpp is a real POS.
I think I know what it is. tradcpp uses '\0' to indicate the end of
input buffers (not that it always bothers to check, but still...).
Your <ctype.h> patch redefined is_nvspace to include '\0', since that
is what cpplib wants. However, is_nvspace is used by SKIP_WHITE_SPACE
in tradcpp.c too. I think you can guess the rest... :-)
Neil.
* tradcpp.h: For tradcpp, NUL is not whitespace.
Index: tradcpp.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tradcpp.h,v
retrieving revision 1.3
diff -u -p -r1.3 tradcpp.h
--- tradcpp.h 2000/12/08 03:00:24 1.3
+++ tradcpp.h 2000/12/11 19:35:19
@@ -39,6 +39,6 @@ extern int test_assertion PARAMS ((unsig
#define is_idchar(x) ISIDNUM(x)
#define is_idstart(x) ISIDST(x)
#define is_space(x) ISSPACE(x)
-#define is_nvspace(x) IS_NVSPACE(x)
+#define is_nvspace(x) (IS_NVSPACE(x) && x != '\0')
#endif /* ! _TRADCPP_H_ */
More information about the Gcc-bugs
mailing list