svn commit: r300557 - head/usr.sbin/apmd

Peter Wemm peter at wemm.org
Thu May 26 18:18:09 UTC 2016


On Thursday, May 26, 2016 07:54:20 PM Jilles Tjoelker wrote:
> On Tue, May 24, 2016 at 08:52:32AM -0700, John Baldwin wrote:
> > On Monday, May 23, 2016 09:24:41 PM Alan Somers wrote:
> > > On Mon, May 23, 2016 at 9:15 PM, Peter Wemm <peter at freebsd.org> wrote:
> > > > Author: peter
> > > > Date: Tue May 24 03:15:46 2016
> > > > New Revision: 300557
> > > > URL: https://svnweb.freebsd.org/changeset/base/300557
> > > > 
> > > > Log:
> > > >   It seems <sys/types.h> is a new prerequisite for <bitstring.h> after
> > > >   r300539. Attempt to fix the build for i386.
> > > > 
> > > > Modified:
> > > >   head/usr.sbin/apmd/apmd.c
> > > >   head/usr.sbin/apmd/apmdlex.l
> > > >   head/usr.sbin/apmd/apmdparse.y
> > > 
> > > Are you sure this is necessary, even after 300544?
> > 
> > Actually, we try to avoid nested includes when possible for userland,
> > so I'd be inclined to drop the <sys/types.h> nested include and just
> > add <sys/types.h> to the places that need it.  Userland code in the
> > base system is supposed to have <sys/types.h> or <sys/param.h> as the
> > first #include anyway (which apmd was not following), so any fixes to
> > userland are probably style fixes anyway.
> 
> This is traditional BSD convention, but headers specified by POSIX work
> differently. POSIX headers can be included alone, so files that only
> include POSIX headers rarely need #include <sys/types.h>. This often
> causes some ugliness in the header file to use hidden names for things
> to reduce namespace pollution.
> 
> Since <bitstring.h> is not specified by POSIX, it is not required to
> work without prerequisites.

FWIW I have no investment in the commit I made - I needed it to compile for 
the cluster.  Feel free to change/revert my commit so long as world compiles.

-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com; KI6FJV
UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20160526/37512f5d/attachment.sig>


More information about the svn-src-all mailing list