Use varargs.h for routine with variable number of args
This commit is contained in:
parent
42604d1423
commit
0a5dadfe82
@ -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;
|
||||||
|
|
||||||
|
va_start(args);
|
||||||
|
fmt = va_arg(args, char *);
|
||||||
fprint( STDERR, "ERROR in line %d : ", yylineno);
|
fprint( STDERR, "ERROR in line %d : ", yylineno);
|
||||||
doprnt( STDERR, fmt, &argv);
|
doprnt( STDERR, fmt, args);
|
||||||
fprint( STDERR, "\n");
|
fprint( STDERR, "\n");
|
||||||
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user