summaryrefslogtreecommitdiffstats
path: root/mandoc_msg.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-01-10 06:29:00 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-01-10 06:29:00 +0000
commit4bfa887201da03d46daafa5d4426ba288eb6e8e7 (patch)
tree9f25c924ba628935483f3831cd0e4125f350c7a8 /mandoc_msg.c
parentda0aa06476cbc1023f263447977a576ef15a6090 (diff)
downloadmandoc-4bfa887201da03d46daafa5d4426ba288eb6e8e7.tar.gz
Initializers for file-scope static variables should be compile-time
constants, and while stderr is a compile-time constant in OpenBSD, Kelvin Sherlock <ksherlock at gmail dot com> reports that it isn't on some other systems, for example on FreeBSD or Linux. So do the initialization by calling mandoc_msg_setoutfile() from main() instead.
Diffstat (limited to 'mandoc_msg.c')
-rw-r--r--mandoc_msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mandoc_msg.c b/mandoc_msg.c
index 9f366cef..1a133f1c 100644
--- a/mandoc_msg.c
+++ b/mandoc_msg.c
@@ -240,7 +240,7 @@ static const char *const type_message[MANDOCERR_MAX] = {
"ignoring macro in table",
};
-static FILE *fileptr = stderr;
+static FILE *fileptr = NULL;
static const char *filename = NULL;
static enum mandocerr min_type = MANDOCERR_MAX;
static enum mandoclevel rc = MANDOCLEVEL_OK;