Comment Comment by messe > Another interesting choice in this project is to make lengths signed:There are good reasons for this choice in C (and C++) due to broken integer promotion and casting rules.See: "Subscripts and sizes should be signed" (Bjarne Stroustrup) https://open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1428r0...As a nice bonus, it means that ubsan traps on overflow (unsigned overflows just wrap). parent messe 1 year ago
There are good reasons for this choice in C (and C++) due to broken integer promotion and casting rules.
See: "Subscripts and sizes should be signed" (Bjarne Stroustrup) https://open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1428r0...
As a nice bonus, it means that ubsan traps on overflow (unsigned overflows just wrap).