Date: Sat, 31 May 2014 23:35:43 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Jilles Tjoelker <jilles@stack.nl> Cc: freebsd-gnats-submit@freebsd.org, freebsd-standards@freebsd.org, Christian Neukirchen <chneukirchen@gmail.com> Subject: Re: standards/188316: Visibility of ntohl etc. and POSIX 2008 Message-ID: <20140531224728.G1905@besplex.bde.org> In-Reply-To: <20140518215050.GA8365@stack.nl> References: <201404061430.s36EUbFE092028@cgiserv.freebsd.org> <20140407024203.M6470@besplex.bde.org> <20140518215050.GA8365@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
I finally got back to this. On Sun, 18 May 2014, Jilles Tjoelker wrote: > On Mon, Apr 07, 2014 at 03:43:44AM +1000, Bruce Evans wrote: >> On Sun, 6 Apr 2014, Christian Neukirchen wrote: >>>> Fix: >>> Guard the definition with __POSIX_VISIBLE >= 200112. > >> This is wrong too, and is inconsistent with <arpa/inet.h> where there >> the symbols are defined unconditionally (if this wouldn't be redundant). >> The correctness of this depends on the symbols being in a header that >> doesn't exist in versions of POSIX that don't have the symbols. I > ... > So you propose to change the "#if !defined(_KERNEL) && __BSD_VISIBLE" > conditional to "#ifndef _KERNEL"? This affects only old versions of > POSIX (where <netinet/in.h> may not be included anyway) and non-POSIX > standard C (which does not define <netinet/in.h> either). > Note that there are other __POSIX_VISIBLE >= 200112 conditionals in > <netinet/in.h>, so the submitter's change may be more consistent, even > if it is somehow wrong. I see you committed a version that changed to a __POSIX_VISIBLE conditional. There were only 2 _POSIX_VISIBLE conditionals. They were mostly for ipv6 things, so removing them won't expose many problematic symbols. I'm surprised POSIX had so much support for ipv6 in 2001. The ipv6 extensions are in mostly in netinet6/in6.h. They are fairly carefully ifdefed, and of course are mostly spelled with a '6' to keep them separate from ipv4 names (which are mostly not spelled with a '4'). Unfortunately, their namspace isn't very consistent. POSIX reserves mainly IP6, IPV6_, IN6_, in6_, s6_ and sin6_ as prefixes, and still has special cases like sockaddr_in6 and in6addr_any where the '6' is not part of a prefix or not followed by an underscores. FreeBSD extensions extend the mess, e.g., by using inet6_ instead of in6_ as a prefix for most functions. POSIX avoided the corresponding mistake for ipv4 (the alternative spellings in_ and inet_) for the lower case versions, and avoided reserving INET6_ as a prefix (it is only used for special cases like AF_INET6). Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140531224728.G1905>