Reply to post: Re: Sounds like a good idea

Keen to go _ExtInt? LLVM Clang compiler adds support for custom width integers

bombastic bob Silver badge
Devil

Re: Sounds like a good idea

C already has bit-size designators within a structure, like

struct thingy

{

unsigned int nine_bit:9;

};

etc. - it'll get padded out to a power of 2 [probably native word size] but you can modify that with packing and so on.

Thing is, as I understand this can cause a bit of trouble with endian-ness so it's almost a YMMV kind of thing. As a result I end up hard-implementing the non-standard integer types with macros so that it's consistent regardless of integer size or endian-ness. [portable structure definitions that compile on x86, amd64, ARM, _and_ an Arduino, using those binary structures to transfer data back/forth between all of those]

having the designated _ExtInt support would probably help a LOT.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2021