aboutsummaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:17:58 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:17:58 +0300
commite888f1834b88270590b7e04d64c03c75863e4565 (patch)
treeab679ecbf16dc4f11b90a53f4b1e0084d78c98b0 /msg.c
parentfae4762eba9ff7bb466a600130e9c90eaac6b0bc (diff)
downloadegawk-e888f1834b88270590b7e04d64c03c75863e4565.tar.gz
egawk-e888f1834b88270590b7e04d64c03c75863e4565.tar.bz2
egawk-e888f1834b88270590b7e04d64c03c75863e4565.zip
Move to gawk-3.1.2.
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/msg.c b/msg.c
index 8b113c86..672d0867 100644
--- a/msg.c
+++ b/msg.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2001, 2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -28,12 +28,9 @@
int sourceline = 0;
char *source = NULL;
-static char *srcfile = NULL;
+static const char *srcfile = NULL;
static int srcline;
-/* prototype needed for ansi / gcc */
-void err P((const char *s, const char *emsg, va_list argp));
-
/* err --- print an error message with source line and file and record */
/* VARARGS2 */
@@ -65,7 +62,7 @@ err(const char *s, const char *emsg, va_list argp)
(void) fprintf(stderr, "FILENAME=%s ", file);
(void) fprintf(stderr, "FNR=%ld) ", FNR);
}
- (void) fprintf(stderr, s);
+ (void) fprintf(stderr, "%s", s);
vfprintf(stderr, emsg, argp);
(void) fprintf(stderr, "\n");
(void) fflush(stderr);
@@ -80,7 +77,7 @@ err(const char *s, const char *emsg, va_list argp)
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- msg(char *mesg, ...)
+ msg(const char *mesg, ...)
#else
/*VARARGS0*/
msg(va_alist)
@@ -104,7 +101,7 @@ void
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- warning(char *mesg, ...)
+ warning(const char *mesg, ...)
#else
/*VARARGS0*/
warning(va_alist)
@@ -126,7 +123,7 @@ void
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- error(char *mesg, ...)
+ error(const char *mesg, ...)
#else
/*VARARGS0*/
error(va_alist)
@@ -149,17 +146,20 @@ void
/* set_loc --- set location where a fatal error happened */
void
-set_loc(char *file, int line)
+set_loc(const char *file, int line)
{
srcfile = file;
srcline = line;
+
+ /* This stupid line keeps some compilers happy: */
+ file = srcfile; line = srcline;
}
/* fatal --- print an error message and die */
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- r_fatal(char *mesg, ...)
+ r_fatal(const char *mesg, ...)
#else
/*VARARGS0*/
r_fatal(va_alist)