Wideranging Bug in /lib/cpp
eric at adec23.UUCP
eric at adec23.UUCP
Thu Jun 2 01:02:50 AEST 1983
The problem noted by Harry Weeks (ucbvax!G:alpines) is caused by an error
in the lexical analyzer portion of the C preprocessor.
The character to hexadecimal conversion code looks like:
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
t = c-'a'; if (b>10) break;
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
t = c - 'A'; if (b>10) break;
The bug can be fixed by changing this to:
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
t = c-'a'+10; if (b>10) break;
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
t = c - 'A'+10; if (b>10) break;
Eric Norum
Advanced Digital Engineering Corporation
(..!utah-cs!sask!hssg40!adec23!eric)
More information about the Comp.lang.c
mailing list