]> cvs.zerfleddert.de Git - micropolis/blob - src/tcl/panic.c
Fixes for compilation with gcc 15
[micropolis] / src / tcl / panic.c
1 /*
2 * panic.c --
3 *
4 * Source code for the "panic" library procedure for Tcl;
5 * individual applications will probably override this with
6 * an application-specific panic procedure.
7 *
8 * Copyright 1988-1991 Regents of the University of California
9 * Permission to use, copy, modify, and distribute this
10 * software and its documentation for any purpose and without
11 * fee is hereby granted, provided that the above copyright
12 * notice appears in all copies. The University of California
13 * makes no representations about the suitability of this
14 * software for any purpose. It is provided "as is" without
15 * express or implied warranty.
16 */
17
18 #ifndef lint
19 static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/panic.c,v 1.3 91/10/10 11:25:51 ouster Exp $ SPRITE (Berkeley)";
20 #endif
21
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <stdarg.h>
25 \f
26 /*
27 *----------------------------------------------------------------------
28 *
29 * panic --
30 *
31 * Print an error message and kill the process.
32 *
33 * Results:
34 * None.
35 *
36 * Side effects:
37 * The process dies, entering the debugger if possible.
38 *
39 *----------------------------------------------------------------------
40 */
41
42 /* VARARGS ARGSUSED */
43 void
44 panicVA(
45 char *format, /* Format string, suitable for passing to
46 * fprintf. */
47 va_list argList /* Variable argument list. */
48 )
49 {
50 char *arg1, *arg2, *arg3; /* Additional arguments (variable in number)
51 * to pass to fprintf. */
52 char *arg4, *arg5, *arg6, *arg7, *arg8;
53
54 arg1 = va_arg(argList, char *);
55 arg2 = va_arg(argList, char *);
56 arg3 = va_arg(argList, char *);
57 arg4 = va_arg(argList, char *);
58 arg5 = va_arg(argList, char *);
59 arg6 = va_arg(argList, char *);
60 arg7 = va_arg(argList, char *);
61 arg8 = va_arg(argList, char *);
62
63 (void) fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5, arg6,
64 arg7, arg8);
65 (void) fflush(stderr);
66 abort();
67 }
68
69 void
70 panic(
71 char *format, /* Format string, suitable for passing to
72 * fprintf. */
73 ...
74 )
75 {
76 va_list argList;
77
78 va_start(argList, format);
79 panicVA(format, argList);
80 }
Impressum, Datenschutz