call abort() instead of exit()
[libfirm] / ir / common / error.c
1 /*
2  * Project:     libFIRM
3  * File name:   ir/common/error.c
4  * Purpose:     Error handling for libFirm
5  * Author:      Michael Beck
6  * Modified by:
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (C) 1998-2006 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12 #ifdef HAVE_CONFIG_H
13 # include "config.h"
14 #endif
15
16 #include <stdlib.h>
17
18 #include <stdio.h>
19 #include <stdarg.h>
20 #include "error.h"
21
22 NORETURN panic(const char *fmt, ...)
23 {
24   va_list ap;
25
26   fputs("libFirm panic: ", stderr);
27   va_start(ap, fmt);
28   vfprintf(stderr, fmt, ap);
29   va_end(ap);
30   putc('\n', stderr);
31   abort();
32 }