All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH rpcbind] src: include cdefs.h for the __P() macro
Date: Mon, 15 Aug 2016 00:13:52 +0200	[thread overview]
Message-ID: <20160814221352.GI30771@free.fr> (raw)
In-Reply-To: <7736F23D-7AA5-4ABD-9693-99C9DCE03B91@oracle.com>

Chuck, All,

On 2016-08-14 14:30 -0400, Chuck Lever spake thusly:
> > On Aug 13, 2016, at 10:05 AM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > 
> > The __P() macro is defined in cdefs.h, so we must include it explicitly
> > rather than relying on it being included by another header.
> > 
> > cdefs.h is a glibc-ism; glibc includes it almost everywhere from its own
> > headers. So it automatically gets included for glibc.
> > 
> > However, cdefs.h is not present in musl, so its headers do not include
> > it. We must thus include it when we need __P() (of course, one will have
> > to provide his own cdefs.h in this case).
> 
> Simply adding "#include <sys/cdefs.h>" seems like the wrong approach.
> If cdefs.h is not guaranteed to exist, the appropriate thing to do
> is provide some autoconf machinery to define __P() in its absence.

OpenEmbedded provides comaptibility headers:
    http://git.openembedded.org/openembedded-core/tree/meta/recipes-core/bsd-headers/bsd-headers

In Buildroot, we're adding them too (not yet applied, WIP):
    http://lists.busybox.net/pipermail/buildroot/2016-August/169722.html

Other embedded buildsystem may each have their own fix in a way or
another...

Mainstream distros are more-or-less all based on glibc, except for a few
outliers, like Alpine Linux (also based on musl), and they've gone on
the "remove __P()" route:
    http://git.alpinelinux.org/cgit/aports/tree/main/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch

> On the other hand, I wonder if we need to continue to preserve K&R C
> compatibility in this code base. Perhaps instead the uses of __P()
> should be eliminated?

I tried to provide a minimalist approach, that consists in assuming that
cdefs.h is present.

But I do agree that pre-ANSI compatibility is probably a little tiny
wee bit excessive nowadays. Virtually all current compilers do accept
function prototypes, nowadays...

I can work on a patch that does just get rid of the use of __P(). (we
can't really vampirise the patch from Alpine, as there's no SoB or such
origin information on it; not that redoing the patch would be too
difficult either...).

So, what route, now? ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2016-08-14 22:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13 14:05 [PATCH rpcbind] src: include cdefs.h for the __P() macro Yann E. MORIN
2016-08-14 18:30 ` Chuck Lever
2016-08-14 22:13   ` Yann E. MORIN [this message]
2016-08-15 14:23     ` Chuck Lever
2016-08-15 14:55       ` Yann E. MORIN
2016-08-15 15:16       ` [Libtirpc-devel] " Steve Dickson
2016-08-15 15:48         ` Yann E. MORIN
2016-08-15 16:30           ` Steve Dickson
2016-08-15 17:41             ` Yann E. MORIN
2016-08-15 19:38               ` Mike Frysinger

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=20160814221352.GI30771@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.