History

error() fixes

bellard committed 24 years ago

Commit f50d0b41 parent b0b2d5d1 file · +11 −5Browse files

Unified · Split

tcc.c+11−5
@@ -464,10 +464,16 @@ void expect(const char *msg) · 463 unmodified lines
464464 error("%s expected", msg);
465465 }
466466
467−void warning(const char *msg)
467+void warning(const char *fmt, ...)
468468 {
469+ va_list ap;
470+
471+ va_start(ap, fmt);
469472 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);
471477 }
472478
473479 void skip(int c)
@@ -2864,7 +2870,7 @@ int ist(void) · 2390 unmodified lines
28642870 next();
28652871 basic_type1:
28662872 if ((t & VT_BTYPE) != 0)
2867− error("too many basic types %x", t);
2873+ error("too many basic types");
28682874 t |= u;
28692875 break;
28702876 case TOK_VOID:
@@ -3418,7 +3424,7 @@ void unary(void) · 547 unmodified lines
34183424 }
34193425 #endif
34203426 if (sa)
3421− error("too few arguments to function %x", sa->t);
3427+ error("too few arguments to function");
34223428 skip(')');
34233429 gfunc_call(&gf);
34243430 /* return value */
@@ -4157,7 +4163,7 @@ int decl_initializer_alloc(int t, int has_init) · 732 unmodified lines
41574163 level = 0;
41584164 while (level > 0 || (tok != ',' && tok != ';')) {
41594165 if (tok < 0)
4160− error("unexpect end of file in initializer");
4166+ error("unexpected end of file in initializer");
41614167 tok_add2(&init_str, &init_len, tok, &tokc);
41624168 if (tok == '{')
41634169 level++;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t