aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorbellard <bellard>2001-12-19 23:01:51 +0000
committerbellard <bellard>2001-12-19 23:01:51 +0000
commitf50d0b4488889a2b0a5993c083fb4ccdb900610c (patch)
tree7635f86eee56a990ee11103712ec2c3321b00311 /tcc.c
parentb0b2d5d2e9548c83aab494831def6e028eecc9e4 (diff)
downloadtinycc-f50d0b4488889a2b0a5993c083fb4ccdb900610c.tar.gz
tinycc-f50d0b4488889a2b0a5993c083fb4ccdb900610c.tar.bz2
error() fixes
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tcc.c b/tcc.c
index 9ff67a8..91a70f3 100644
--- a/tcc.c
+++ b/tcc.c
@@ -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++;