If you are sure that this is going to be the case, then use uint_least8_t.
Both problems are being avoided if you use [u]int_leastN_t Or if you do not make assumptions of the sizes of int, something that only bad programmers do.
Terrible The first rule of C is to ALWAYS use C The second rule of C is to NEVER use [u]intN_t, use [u]int_leastN_t instead and (unsigned) char when you want to deal with bytes The 3rd rule of C is to never use anything…
Do you have any reason for supporting uint16_t instead of uint_least16_t? Their point is against portability as they may not exist at all.
[u]intN_t may not exist. If you are working with arrays, always use size_t if not, use [u]int_leastN_t in 99% of the cases, except if you are working with network protocols, [u]intN_t is a bad choice
If you are sure that this is going to be the case, then use uint_least8_t.
Both problems are being avoided if you use [u]int_leastN_t Or if you do not make assumptions of the sizes of int, something that only bad programmers do.
Terrible The first rule of C is to ALWAYS use C The second rule of C is to NEVER use [u]intN_t, use [u]int_leastN_t instead and (unsigned) char when you want to deal with bytes The 3rd rule of C is to never use anything…
Do you have any reason for supporting uint16_t instead of uint_least16_t? Their point is against portability as they may not exist at all.
[u]intN_t may not exist. If you are working with arrays, always use size_t if not, use [u]int_leastN_t in 99% of the cases, except if you are working with network protocols, [u]intN_t is a bad choice