discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: "LÉVAI Dániel" <leva@ecentrum.hu>
Cc: discuss@mdocml.bsd.lv
Subject: Re: "cannot parse date" for a seemingly valid .Dd parameter
Date: Thu, 28 Aug 2014 21:49:11 +0200	[thread overview]
Message-ID: <20140828194910.GW912@iris.usta.de> (raw)
In-Reply-To: <20140828180617.GA15202@serenity.local>

Hi Daniel,

LÉVAI Dániel wrote on Thu, Aug 28, 2014 at 08:06:17PM +0200:
> On cs, aug 28, 2014 at 19:35:22 +0200, Ingo Schwarze wrote:
>> LÉVAI Dániel wrote on Thu, Aug 28, 2014 at 06:32:15PM +0200:

>>> manpath: no

>> By the way, that is odd.  Given that the bug hides so skillfully,
>> i'd like to pay attention to any clue.  You say you are on Linux?

> Yes, this is on Linux; a slightly modified version of Slackware.

Interesting.  I always thought all Linux distros had manpath(1),
but apparently, starting a sentence with "All Linux distros..."
is bound to end up in an untruth.  Well, i sympathize with not
using manpath(1).  :)

So no problem there.

> $ 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...

> Sorry for not posting the exact steps I've been using to compile
> mdocml... rookie mistake..

You?  A rookie?  You are not a rookie!  "Sir, look, that man over
there is an impostor!  He's posing as a rookie!"

> config.h:
[...]
> #define VERSION "1.13.1"
> 
> #if !defined(__BEGIN_DECLS)

Your problem is right here.  No #define HAVE_... whatsoever.

> 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.

  # For all settings documented in this file, there are reasonable
  # defaults and/or the ./configure script attempts autodetection.
  # Consequently, you only need to create a file ./configure.local
  # and put any of these settings into it if ./configure autodetection
  # fails or if you want to make different choices for other reasons.
  
  # If autodetection fails, please tell <tech@mdocml.bsd.lv>.
  
  # We recommend that you write ./configure.local from scratch and
  # only put the lines there you need.  This file contains examples.
  # It is not intended as a template to be copied as a whole.

  [...]

  # In manual pages written in the mdoc(7) language, the operating system
  # version is displayed in the page footer line.  If an operating system
  # is specified as an argument to the .Os macro, that is always used.
  # If the .Os macro has no argument and an operation system is specified
  # with the mandoc(1) -Ios= command line option, that is used.
  # Otherwise, the uname(3) library function is called at runtime to find
  # the name of the operating system.
  # If you do not want uname(3) to be called but instead want a fixed
  # string to be used, use the following line:
  
  OSNAME="OpenBSD 5.5"
 
Fine, so all is understood now and no more patches are needed.

Thanks for reporting the bug you didn't intend to, and don't worry too
much that the one you did report turned out to be pilot error - it *was*
tricky after all.

I also learned something about Slackware.
Btw., can you update this:
  http://slackbuilds.org/slackbuilds/14.1/system/mdocml/ 
?

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2014-08-28 19:50 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 [this message]
2014-08-28 21:07                   ` LÉVAI Dániel
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=20140828194910.GW912@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mdocml.bsd.lv \
    --cc=leva@ecentrum.hu \
    /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).