From 6ea0fa77db3eab0494ad1b95f3dc59ce3dd506f7 Mon Sep 17 00:00:00 2001 From: dick Date: Wed, 4 Oct 1989 16:04:02 +0000 Subject: [PATCH] varargs in panic() --- lang/cem/lint/lpass2/report.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lang/cem/lint/lpass2/report.c b/lang/cem/lint/lpass2/report.c index 9f80e15cc..7ca1700c4 100644 --- a/lang/cem/lint/lpass2/report.c +++ b/lang/cem/lint/lpass2/report.c @@ -106,13 +106,22 @@ rep_loc(id) } } -/* VARARGS1 */ -panic(fmt, args) - char *fmt; +/* VARARGS */ +panic(va_alist) /* fmt, args */ + va_dcl { - fprint(ERROUT, "PANIC, lint, pass2: line %d: ", LineNr); - doprnt(ERROUT, fmt, &args); - fprint(ERROUT, "\n"); + va_list ap; + + va_start(ap); + { + char *fmt = va_arg(ap, char *); + + fprint(ERROUT, "PANIC, lint, pass2: line %d: ", LineNr); + doprnt(ERROUT, fmt, ap); + fprint(ERROUT, "\n"); + } + va_end(ap); + exit(1); }