diff options
author | 2019-01-10 06:29:00 +0000 | |
---|---|---|
committer | 2019-01-10 06:29:00 +0000 | |
commit | 6719c1661f033ee6a197313c077e571a96ce1359 (patch) | |
tree | a4f18b3c969a7a17371c6910ecffe83f54ee8735 /mandoc_msg.c | |
parent | 81110a42d3e8acf54bd059afb29098770437d398 (diff) | |
download | mandoc-6719c1661f033ee6a197313c077e571a96ce1359.tar.gz mandoc-6719c1661f033ee6a197313c077e571a96ce1359.tar.zst mandoc-6719c1661f033ee6a197313c077e571a96ce1359.zip |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mandoc_msg.c b/mandoc_msg.c index 5dfa26d1..4c4fabb9 100644 --- a/mandoc_msg.c +++ b/mandoc_msg.c @@ -1,4 +1,4 @@ -/* $Id: mandoc_msg.c,v 1.4 2018/12/16 00:21:05 schwarze Exp $ */ +/* $Id: mandoc_msg.c,v 1.5 2019/01/10 06:29:00 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze <schwarze@openbsd.org> @@ -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; |