X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=lexer.c;h=faecfe36fd75f32a12ceca0c883bdb597f1e97b1;hb=73b92d8d3495b12f38de4bbaf705cbb4fce49708;hp=990d285d531cdce71a4b4817b8991227ca1677ee;hpb=68a770de4603c696518d3dd2f278985262a1a2a2;p=cparser diff --git a/lexer.c b/lexer.c index 990d285..faecfe3 100644 --- a/lexer.c +++ b/lexer.c @@ -343,7 +343,7 @@ static void parse_integer_suffix(bool is_oct_hex) if(v >= TARGET_LONG_MIN && v <= TARGET_LONG_MAX) { lexer_token.datatype = type_long; return; - } else if(is_oct_hex && v >= 0 && v <= TARGET_ULONG_MAX) { + } else if(is_oct_hex && v >= 0 && (unsigned long long)v <= (unsigned long long)TARGET_ULONG_MAX) { lexer_token.datatype = type_unsigned_long; return; } @@ -957,6 +957,9 @@ static void parse_wide_character_constant(void) end_of_wide_char_constant:; size_t size = (size_t) obstack_object_size(&symbol_obstack); + assert(size % sizeof(wchar_rep_t) == 0); + size /= sizeof(wchar_rep_t); + const wchar_rep_t *string = obstack_finish(&symbol_obstack); lexer_token.type = T_WIDE_CHARACTER_CONSTANT; @@ -1373,7 +1376,7 @@ static void parse_preprocessor_directive(void) #define ELSE_CODE(code) \ default: \ - code; \ + code \ } \ } /* end of while(1) */ \ break;