discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Peter Bray <pdb_ml@yahoo.com.au>
To: discuss@mdocml.bsd.lv
Subject: Re: mdocml [CVS_2015_11_07] Code needs HAVE_ERR guards
Date: Sat, 07 Nov 2015 15:14:26 +1100	[thread overview]
Message-ID: <563D7AA2.40306@yahoo.com.au> (raw)
In-Reply-To: <563D6968.8020401@yahoo.com.au>

All,

Sorry for following up to my own post, but the patch provided included a 
redundant automated edit (I used perl(1) to edit the code for the patch).

Regardless of the solution chosen, 'compat_err.c' should not be 
including <err.h> as we already know we don't have it, because of the 
larger cpp(1) guards (#if HAVE_ERR) around the code.

If using solution 1, delete the '#include <err.h>'
If using solution 2, change the '#include <err.h>' to '#include 
"compat_err.h"'

Regards,

Peter


On  7/11/15 02:00 PM, Peter Bray wrote:
> Greetings,
>
> Ingo has posted a patch to regarding
>
>      mandoc whatis(1): autodetect RE syntax for word boundaries
>
> So I thought I would try compiling mdocml_cvs on Solaris 10 and 11 again.
>
> The "configure" script checks for the presence of "err.h", setting
> HAVE_ERR to 0 or 1 based on the check result.
>
> Unlike the HAVE_FTS check the, code that uses '#include <err.h>' does
> not wrap this preprocessor directive in a guard.
>
> Two possible simple solutions exist (based on what I have seen so far).
>
> 1. Wrap the include directive in a simple '#if HAVE_ERR' and '#endif'.
>     Patch included.
>
> 2. Take the HAVE_FTS approach and move the declarations from the generated
>     config.h to compat_err.h and like fts.h, use a conditional of the form:
>
> #if HAVE_ERR
> #  include <err.h>
> #else
> #  include "compat_err.h"
> #fi
>
> I'll leave it to the developers and maintainers to choose the
> appropriate solution for their code base.
>
> Regards,
>
> Peter Bray
> Sydney, Australia
>
> PS: Discovered on Solaris 10 which does not have <err.h>

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

  reply	other threads:[~2015-11-07  4:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  3:00 Peter Bray
2015-11-07  4:14 ` Peter Bray [this message]
2015-11-07 14:26   ` Ingo Schwarze

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=563D7AA2.40306@yahoo.com.au \
    --to=pdb_ml@yahoo.com.au \
    --cc=discuss@mdocml.bsd.lv \
    /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).