Wednesday 15 April 2015

c - Difference between u8, uint8_t, __u8 and __be8 -



c - Difference between u8, uint8_t, __u8 and __be8 -

while browsing linux networking code, came across these datatypes:

u8 uint8_t __u8 __be8

(same things 16, 32 , 64 bits)

can please explain difference between these datatypes , utilize which? have seen definitions of these datatypes not clear me.

uint8_t standard c , represents unsigned 8-bit integral type. if on scheme not have 8-bit addressable units not defined; otherwise typedef unsigned char.

anything __ in reserved implementation use. means compiler writers , standard library writers can utilize identifiers without worrying name clash user code. may see when looking in internals of standard library implementation.

u8 non-standard means same uint8_t. reason u8 might used in code written before uint8_t added standard c.

c linux linux-kernel

No comments:

Post a Comment