144
148
flag = getflag(s);
145
for(l=tprot; l; l=l->link)
149
for(l=*prot; l; l=l->link)
146
150
if(beq(flag, l->flag) && sametype(t, l->type))
148
152
l = alloc(sizeof(*l));
156
newname(char *s, int p)
160
newname(char *s, int p, int count)
160
164
for(l=tname; l; l=l->link)
161
165
if(strcmp(l->name, s) == 0) {
166
if(p >= 0 && l->param != p)
163
167
yyerror("vargck %s already defined\n", s);
166
173
l = alloc(sizeof(*l));
305
/*#pragma varargck type name int*/
309
l = newname(s->name, -1, -1);
314
while((c = getnsc()) == '*')
317
newprot(s, ty, "a", &l->prot);
279
321
/*#pragma varargck type O int*/
445
// fetch count, then check remaining length
454
diag(n, "can't find count arg");
457
if(a->op != OCONST || !typechl[a->type->etype]) {
458
diag(n, "count is invalid constant");
468
diag(n, "found %d argument%s after count %d", i, i == 1 ? "" : "s", j);
472
// check that all arguments after param or count
473
// are listed in type list.
486
diag(n, "can't find count/param arg");
491
for(tl=l->prot; tl; tl=tl->link)
492
if(sametype(a->type, tl->type))
495
diag(a, "invalid type %T in call to %s", a->type, s);
406
505
b = nextarg(b, &a);
410
warn(n, "cant find format arg");
509
diag(n, "can't find format arg");
413
512
if(!sametype(indchar, a->type)) {
414
warn(n, "format arg type %T", a->type);
513
diag(n, "format arg type %T", a->type);
417
516
if(a->op != OADDR || a->left->op != ONAME || a->left->sym != symstring) {