Subject: Re: Data types in kernel-compatible code
To: Florian Stoehr <netbsd@wolfnode.de>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 01/01/2005 22:39:58
Florian Stoehr wrote:
> for normal I always program in c++, not pure c.
>
> I have a question regarding data types used in kernel or other
> code in the netbsd project.
>
> For written data (to file) in my programs, I use the "int32_t" or
> "uint32_t" types.
>
> Is it okay to use those types (from /usr/include/sys/stdint.h) in
> "netbsd-compatible" code, regarding the style?
The C99 types (intN_t, uintN_t) are preferred, both in the kernel and
in userland.
> (I read "u_long" somewhere)?
u_long/long, especially for data written to files, isn't going to be
compatible across 32- and 64-bit platforms.
Simon.
--
Simon Burge <simonb@wasabisystems.com>
NetBSD Support and Service: http://www.wasabisystems.com/