diff options
| author | bellard <bellard> | 2001-12-19 23:01:51 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2001-12-19 23:01:51 +0000 |
| commit | f50d0b4488889a2b0a5993c083fb4ccdb900610c (patch) | |
| tree | 7635f86eee56a990ee11103712ec2c3321b00311 | |
| parent | b0b2d5d2e9548c83aab494831def6e028eecc9e4 (diff) | |
| download | tinycc-f50d0b4488889a2b0a5993c083fb4ccdb900610c.tar.gz tinycc-f50d0b4488889a2b0a5993c083fb4ccdb900610c.tar.bz2 | |
error() fixes
| -rw-r--r-- | tcc.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -464,10 +464,16 @@ void expect(const char *msg) error("%s expected", msg); } -void warning(const char *msg) +void warning(const char *fmt, ...) { + va_list ap; + + va_start(ap, fmt); printline(); - fprintf(stderr, "warning: %s\n", msg); + fprintf(stderr, "warning: "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); } void skip(int c) @@ -2864,7 +2870,7 @@ int ist(void) next(); basic_type1: if ((t & VT_BTYPE) != 0) - error("too many basic types %x", t); + error("too many basic types"); t |= u; break; case TOK_VOID: @@ -3418,7 +3424,7 @@ void unary(void) } #endif if (sa) - error("too few arguments to function %x", sa->t); + error("too few arguments to function"); skip(')'); gfunc_call(&gf); /* return value */ @@ -4157,7 +4163,7 @@ int decl_initializer_alloc(int t, int has_init) level = 0; while (level > 0 || (tok != ',' && tok != ';')) { if (tok < 0) - error("unexpect end of file in initializer"); + error("unexpected end of file in initializer"); tok_add2(&init_str, &init_len, tok, &tokc); if (tok == '{') level++; |
