-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check type selection for sizes #5
Comments
No, that just hides errors and there is no reason to save this one bit. If some computation gives negative values, errors are obvious. If you use unsigned, they overflow and are more difficult to find. |
I am surprised that you do not like unsigned integers here. I would prefer their use at various places to make the software a bit safer by design. |
Feel free to do so. for (uint32_t i=length-1;i>=0;i--) { ... } 2013/9/6 Markus Elfring notifications@github.com
|
Would you like to point out that the data types "uint32_t" and "size_t" have got different value ranges eventually? |
I guess that a few functions will not work correctly if they will get negative values.
How do you think about to replace any "int" parameter like "length" by the data type "size_t"?
The text was updated successfully, but these errors were encountered: