Unified · Split
| @@ -464,10 +464,16 @@ void expect(const char *msg) · 463 unmodified lines | |||
| 464 | error("%s expected", msg); | 464 | error("%s expected", msg); |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | void warning(const char *msg) | 467 | void warning(const char *fmt, ...) |
| 468 | { | 468 | { |
| 469 | va_list ap; | ||
| 470 | |||
| 471 | va_start(ap, fmt); | ||
| 469 | printline(); | 472 | printline(); |
| 470 | fprintf(stderr, "warning: %s\n", msg); | 473 | fprintf(stderr, "warning: "); |
| 474 | vfprintf(stderr, fmt, ap); | ||
| 475 | fprintf(stderr, "\n"); | ||
| 476 | va_end(ap); | ||
| 471 | } | 477 | } |
| 472 | 478 | ||
| 473 | void skip(int c) | 479 | void skip(int c) |
| @@ -2864,7 +2870,7 @@ int ist(void) · 2390 unmodified lines | |||
| 2864 | next(); | 2870 | next(); |
| 2865 | basic_type1: | 2871 | basic_type1: |
| 2866 | if ((t & VT_BTYPE) != 0) | 2872 | if ((t & VT_BTYPE) != 0) |
| 2867 | error("too many basic types %x", t); | 2873 | error("too many basic types"); |
| 2868 | t |= u; | 2874 | t |= u; |
| 2869 | break; | 2875 | break; |
| 2870 | case TOK_VOID: | 2876 | case TOK_VOID: |
| @@ -3418,7 +3424,7 @@ void unary(void) · 547 unmodified lines | |||
| 3418 | } | 3424 | } |
| 3419 | #endif | 3425 | #endif |
| 3420 | if (sa) | 3426 | if (sa) |
| 3421 | error("too few arguments to function %x", sa->t); | 3427 | error("too few arguments to function"); |
| 3422 | skip(')'); | 3428 | skip(')'); |
| 3423 | gfunc_call(&gf); | 3429 | gfunc_call(&gf); |
| 3424 | /* return value */ | 3430 | /* return value */ |
| @@ -4157,7 +4163,7 @@ int decl_initializer_alloc(int t, int has_init) · 732 unmodified lines | |||
| 4157 | level = 0; | 4163 | level = 0; |
| 4158 | while (level > 0 || (tok != ',' && tok != ';')) { | 4164 | while (level > 0 || (tok != ',' && tok != ';')) { |
| 4159 | if (tok < 0) | 4165 | if (tok < 0) |
| 4160 | error("unexpect end of file in initializer"); | 4166 | error("unexpected end of file in initializer"); |
| 4161 | tok_add2(&init_str, &init_len, tok, &tokc); | 4167 | tok_add2(&init_str, &init_len, tok, &tokc); |
| 4162 | if (tok == '{') | 4168 | if (tok == '{') |
| 4163 | level++; | 4169 | level++; |