Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Oct 1996 02:00:33 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        ache@nagual.ru, bde@zeta.org.au
Cc:        current@FreeBSD.org
Subject:   Re: 'howmany' cruft
Message-ID:  <199610031600.CAA20441@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>What I find in
>sys/types.h:
>#ifndef howmany
>#define	howmany(x, y)	(((x) + ((y) - 1)) / (y))
>#endif
>I find it because netpbm redifines it and gcc produce warning on this place.
>It looks very suspicious for me (I mean ANSI namespace violation).
>Do we really need it? Can we rename it to _howmany at least?

Lite2 changed the whitespace in it and netpbm presumably has the old
version.

Grep shows that it is used in a few places in /usr/src/*bin (subdirs not
checked): ls, dump, fsck, newfs, restore, du, systat and diskpart.  These
would be easy to fix, but I'm worried about ports.

Other macro pollution in <sys/types.h> found by inspecting the
output of cc -E -dM:

ntohl, BYTE_ORDER_LITTLE_ENDIAN, ntohs, LITTLE_ENDIAN, FD_SET, HTONL,
HTONS, NTOHL, NTOHS, minor, PDP_ENDIAN, NFDBITS, FD_ZERO, NBBY, FD_COPY,
FD_ISSET, makedev, FD_SETSIZE, FD_CLR, major, htonl, htons, BIG_ENDIAN.

Other pollution in <sys/types.h> found by inspecting the output of
cc -E -P | grep -v '^[ 	]*$':

physaddr, u_char, u_short, u_int, u_long, ushort, uint, lseek, fd_mask,
fd_set.

Pollution that is still present if _POSIX_SOURCE is defined:

Everything from <machine/endian.h> (*ENDIAN*, ntoh*, NTOH*); lseek.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610031600.CAA20441>