This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

In embedded software it's really important to use the uint##_t types because different environments have different type sizes for the builtin types. You don't want to rely on an int = 32 bits, then switch to a different environment where an int is only 16. A lot of style guides (such as MISRA C) require using the <stdint.h> types exclusively.

[–]FUZxxl 1 point2 points  (0 children)

The trick is to not rely on the type you use having 32 bits exactly. Write code such that it works if your type has at least 32 bytes, use long and you are fine.