Re: uint8_t vs __u8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Daniel,

> What is the idea behind this two types? When to use one over another.
> Basically, they are the same thing:
>
> typedef  __u8 uint8_t;
>
> In the linux kernel code I've seen both of them used without any clear rule.
>
Basically, they are the same thing.
$ grep uint8_t linux/types.h
typedef		__u8		uint8_t;
$ grep __u8 asm-i386/types.h
typedef unsigned char __u8;

But you'd better use uint8_t in you kernel programming practice rather than use
__u8 directly. Because asm directory varies on different architecture.
The program
will get better portability by using uint8_t.In an other words,
uint8_t provide more
abstraction for '1 byte' type.

-- 
Adam Jiang
------------------------------------------
e-mail:jiang.adam@xxxxxxxxx

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux