Use varargs.h for routine with variable number of args
This commit is contained in:
parent
153a94aad4
commit
497792f739
1 changed files with 12 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <system.h>
|
#include <system.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <varargs.h>
|
||||||
#include "as.h"
|
#include "as.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
|
||||||
|
@ -223,13 +224,18 @@ char *mnem;
|
||||||
|
|
||||||
/*** Error ****************************************************************/
|
/*** Error ****************************************************************/
|
||||||
|
|
||||||
error( fmt, argv)
|
/*VARARGS*/
|
||||||
char *fmt;
|
error(va_alist)
|
||||||
int argv;
|
va_dcl
|
||||||
{
|
{
|
||||||
|
char *fmt;
|
||||||
|
va_list args;
|
||||||
extern int yylineno;
|
extern int yylineno;
|
||||||
|
|
||||||
fprint( STDERR, "ERROR in line %d : ", yylineno);
|
va_start(args);
|
||||||
doprnt( STDERR, fmt, &argv);
|
fmt = va_arg(args, char *);
|
||||||
fprint( STDERR, "\n");
|
fprint( STDERR, "ERROR in line %d : ", yylineno);
|
||||||
|
doprnt( STDERR, fmt, args);
|
||||||
|
fprint( STDERR, "\n");
|
||||||
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue