Date: Tue, 31 Jan 2017 14:23:10 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: Re: [alpine-devel] Non-standard C library On Tue, Jan 31, 2017 at 01:08:07PM -0600, A. Wilcox wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 31/01/17 12:50, William Pitcock wrote: > > On Tue, Jan 31, 2017 at 12:22 PM, Harald Arnesen > > <harald@...gtun.org> wrote: > >> musl defines "IPPORT_RESERVED" in "netdb.h", while both GNU libc > >> and BSD libc define it in "netinet/in.h". And I can't find an > >> e-mail address for a musl developer without subscribing to their > >> mailing list. > > > POSIX.1-2008 clearly says IPPORT_RESERVED shall be defined in <netdb.h>: > http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netdb.h.html > > ..... > > > > I checked on both a Debian and FreeBSD machine and indeed, they > > both have it in netinet/in.h. > > ..... > > however, POSIX.1-2008 also clearly says <netdb.h> "may also make visible > all symbols from <netinet/in.h>". > > > > What shall we do? > > > Theoretically, the code they are compiling is wrong; POSIX only > guarantees the definition in <netdb.h>. However, there is a bit of > leeway in the standard since <netdb.h> may include all symbols from > <netinet/in.h>; if it's defined there, <netdb.h> can pull that header > in providing the definition. > > I would say that the best thing to do in the interests of > compatibility would be to put the definition in <netinet/in.h> *and* > fix whatever broken project that is (Snobol?) to include <netdb.h>. > This is what FreeBSD and glibc both do; define it in <netinet/in.h> > and include that header in <netdb.h>. The name IPPORT_RESERVED is not reserved in the namespace for netinet/in.h, so it can't be added there unless it's conditional on nonstandard feature profile. That might be justifiable if lots of applications had the wrong expectation here, but being that this is the first time we've heard of the issue, it seems there are just a few (or only one) applications which are doing this wrong, and they should just be fixed. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.