From: "LÉVAI Dániel" <leva@ecentrum.hu>
To: Ingo Schwarze <schwarze@usta.de>
Cc: discuss@mdocml.bsd.lv
Subject: Re: "cannot parse date" for a seemingly valid .Dd parameter
Date: Thu, 28 Aug 2014 23:07:31 +0200 [thread overview]
Message-ID: <20140828210731.GB15202@serenity.local> (raw)
In-Reply-To: <20140828194910.GW912@iris.usta.de>
On cs, aug 28, 2014 at 21:49:11 +0200, Ingo Schwarze wrote:
> > $ CFLAGS='-DOSNAME=\"Slackware\ Linux\"' make
>
> Gah. That's not the way to do it.
>
> > $ ./mandoc -Tlint test.1
> > mandoc: ../mdocml/test.1:1:2: WARNING: cannot parse date,
> > using it verbatim: August 27, 2014
>
> Indeed. What happens here is that you completely screw up the
> CFLAGS of ./configure, and all configuration tests fail.
> So strptime(3) cannot be used when compiling mandoc(1),
> and hence, no dates whatsoever can be parsed. We were on
> a completely wrong track with LC_*.
>
> The way to set additional CFLAGS in 1.13.1 was to edit the
> Makefile, uncomment and edit this line right at the top of
> the file:
>
> # Specify this if you want to hard-code the operating system to appear
> # in the lower-left hand corner of -mdoc manuals.
> #
> # CFLAGS += -DOSNAME="\"OpenBSD 5.5\""
>
> > Without the -DOSNAME define, it doesn't emit this warning. I know I'm
> > not crazy! Sort of... :)
>
> Well, as long as you don't break it, ./configure does work...
[...]
But it doesn't seem to break the CFLAGS variable here. Everything stays
in it during compile:
$ CFLAGS='-DOSNAME=OSNAMEEEE' make
rm -f config.log
CC="cc" CFLAGS="-DOSNAME=OSNAMEEEE -DUSE_WCHAR -g -DHAVE_CONFIG_H -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings" DBLIB="-lutil -lsqlite3" \
VERSION="1.13.1" ./configure
/* RUNNING ./CONFIGURE - SHOULD BE USED ONLY VIA MAKE, READ INSTALL */
cc -DOSNAME=OSNAMEEEE -DUSE_WCHAR -g -DHAVE_CONFIG_H -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -c -o eqn_html.o eqn_html.c
cc -DOSNAME=OSNAMEEEE -DUSE_WCHAR -g -DHAVE_CONFIG_H -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -c -o html.o html.c
...
..
.
^^^ Those are the same compiler flags that would have been there without
my CFLAGS "override" on the command line.
Furthermore, the problem also remains when I edit only the Makefile:
$ fgrep OSNAME ./Makefile
# CFLAGS += -DOSNAME="\"OpenBSD 5.5\""
CFLAGS += -DOSNAME="\"Slackware\ Linux\""
$ make
rm -f config.log
CC="cc" CFLAGS="-DOSNAME="\"Slackware\ Linux\"" -DUSE_WCHAR -g -DHAVE_CONFIG_H -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings" DBLIB="-lutil -lsqlite3" \
VERSION="1.13.1" ./configure
/* RUNNING ./CONFIGURE - SHOULD BE USED ONLY VIA MAKE, READ INSTALL */
cc -DOSNAME="\"Slackware\ Linux\"" -DUSE_WCHAR -g -DHAVE_CONFIG_H -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -c -o eqn_html.o eqn_html.c
cc -DOSNAME="\"Slackware\ Linux\"" -DUSE_WCHAR -g -DHAVE_CONFIG_H -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -c -o html.o html.c
...
..
.
$ ./mandoc -Tlint test.1
mandoc: test.1:1:2: WARNING: cannot parse date, using it verbatim: August 27, 2014
Only in the absence of the OSNAME define does mandoc parse the given
date. If I could "screw up" the CFLAGS of configure, then eg. a simple
CFLAGS=-O2 would do that too, but it doesn't; just the -DOSNAME define.
> > But regarding CVS HEAD, even with the OSNAME define, it won't tell me
> > that warning.
>
> Sure, it has become more robust and ignores the rogue variable now
> instead of breaking all over the place.
>
> In 1.13.2, the way to set OSNAME is documented in the file
> configure.local.example.
[...]
Okay, seems clear, I'll keep this in mind when upgrading in the future.
[...]
> Btw., can you update this:
> http://slackbuilds.org/slackbuilds/14.1/system/mdocml/
> ?
Sure thing, but I need to get this problem out of the way :P
Daniel
--
LÉVAI Dániel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D 650C C69B BE4C 83B6 3A8F
--
To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv
next prev parent reply other threads:[~2014-08-28 21:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 14:58 LÉVAI Dániel
2014-08-27 15:07 ` Kristaps Dzonsons
2014-08-27 15:15 ` LÉVAI Dániel
2014-08-28 0:43 ` Ingo Schwarze
2014-08-28 8:39 ` LÉVAI Dániel
2014-08-28 16:11 ` Ingo Schwarze
2014-08-28 16:32 ` LÉVAI Dániel
2014-08-28 17:35 ` Ingo Schwarze
2014-08-28 18:06 ` LÉVAI Dániel
2014-08-28 19:49 ` Ingo Schwarze
2014-08-28 21:07 ` LÉVAI Dániel [this message]
2014-08-29 15:38 ` Ingo Schwarze
2014-08-30 8:57 ` LÉVAI Dániel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140828210731.GB15202@serenity.local \
--to=leva@ecentrum.hu \
--cc=discuss@mdocml.bsd.lv \
--cc=schwarze@usta.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).