2019-05-10 17:17:40 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*
|
|
|
|
* Author: Hans van Staveren
|
|
|
|
*/
|
2006-07-20 23:04:15 +00:00
|
|
|
#include <stdlib.h>
|
1984-05-17 13:42:36 +00:00
|
|
|
#include <stdio.h>
|
2019-05-10 17:17:40 +00:00
|
|
|
#include <stdarg.h>
|
1984-05-17 13:42:36 +00:00
|
|
|
#include "param.h"
|
|
|
|
#include "types.h"
|
1990-09-04 16:42:43 +00:00
|
|
|
#include "tes.h"
|
1984-05-17 13:42:36 +00:00
|
|
|
#include "lookup.h"
|
|
|
|
#include "proinf.h"
|
|
|
|
#include "optim.h"
|
2019-05-10 17:17:40 +00:00
|
|
|
#include "util.h"
|
1984-05-17 13:42:36 +00:00
|
|
|
#include "ext.h"
|
|
|
|
|
|
|
|
/* VARARGS1 */
|
2019-05-10 17:17:40 +00:00
|
|
|
void error(char *s, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, s);
|
1984-05-17 13:42:36 +00:00
|
|
|
|
2019-05-10 17:17:40 +00:00
|
|
|
fprintf(stderr, "%s: error on line %u", progname, linecount);
|
1984-05-17 13:42:36 +00:00
|
|
|
if (prodepth != 0)
|
2019-05-10 17:17:40 +00:00
|
|
|
fprintf(stderr, "(%.*s)", IDL, curpro.symbol->s_name);
|
|
|
|
fprintf(stderr, ": ");
|
|
|
|
vfprintf(stderr, s, ap);
|
|
|
|
fprintf(stderr, "\n");
|
|
|
|
|
|
|
|
va_end(ap);
|
1994-02-25 14:01:54 +00:00
|
|
|
#ifndef NDEBUG
|
1984-05-17 13:42:36 +00:00
|
|
|
abort();
|
1994-02-25 14:01:54 +00:00
|
|
|
#endif
|
2019-05-10 17:17:40 +00:00
|
|
|
exit(EXIT_FAILURE);
|
1984-05-17 13:42:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DIAGOPT
|
2019-05-10 17:17:40 +00:00
|
|
|
void optim(int n)
|
|
|
|
{
|
1984-05-17 13:42:36 +00:00
|
|
|
fprintf(stderr,"Made optimization %d",n);
|
1989-02-06 14:39:08 +00:00
|
|
|
if (prodepth)
|
2019-05-10 17:17:40 +00:00
|
|
|
fprintf(stderr," (%.*s)",IDL,curpro.symbol->s_name);
|
1984-05-17 13:42:36 +00:00
|
|
|
fprintf(stderr,"\n");
|
|
|
|
}
|
|
|
|
#endif
|