Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
annathebannana
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
annathebannana
11y ago
If you are sure that this is going to be the case, then use uint_least8_t.
2.
▲
by
annathebannana
11y ago
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.
3.
▲
by
annathebannana
11y ago
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 else when size_t sho
4.
▲
by
annathebannana
11y ago
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.
5.
▲
by
annathebannana
11y ago
[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