arocc icon indicating copy to clipboard operation
arocc copied to clipboard

Validate digits of binary/octal constants

Open ehaas opened this issue 4 years ago • 0 comments

Error message for invalid binary/octal constants could be improved:

int x = 0b19;
int y = 019;

clang output:

test.c:1:12: error: invalid digit '9' in binary constant
int x = 0b19;
           ^
test.c:2:11: error: invalid digit '9' in octal constant
int y = 019;
          ^

vs arocc

./test.c:1:12: error: expected ';', found 'an integer literal'
int x = 0b19;
           ^
./test.c:2:11: error: expected ';', found 'an integer literal'
int y = 019;
          ^

ehaas avatar Nov 29 '21 06:11 ehaas