shithub: scc

ref: d6ff7f1f2ae3daa13b2d910ff41b6bc4d982d087
dir: /cc2/main.c/

View raw version

#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#include <cc.h>
#include <sizes.h>

#include "cc2.h"
#include "error.h"

extern void parse(void);

void
error(unsigned nerror, ...)
{
	va_list va;
	va_start(va, nerror);
	if (nerror >= ENUMERR)
		fprintf(stderr, "incorrect error number '%d'", nerror);
	else
		vfprintf(stderr, errlist[nerror], va);
	va_end(va);
	putc('\n', stderr);
	exit(EXIT_FAILURE);
}

int
main(void)
{
	parse();
}