svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg

Benjamin Kaduk bjkfbsd at gmail.com
Tue Jan 17 17:48:05 UTC 2017


On Tue, Jan 17, 2017 at 10:57 AM, Ian Lepore <ian at freebsd.org> wrote:

> In my experience, enums are a superior way to define integer constants
> (compared to #define), but they are pure poison as variable types in
> APIs and structures because their size is a compiler implementation
> choice.
>

Well, to some extent. For example, the amd64 sysV ABI says that enum types
are signed fourbyte, with a footnote that "C++ and some implementations of
C permit enums larger than an int. The underlying type is bumped to an
unsigned int, long int or unsigned long int, in that order."

-Ben


More information about the svn-src-head mailing list