Skip to content
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

Be more careful about signed/unsigned comparisons #335

Open
terrillmoore opened this issue Jun 12, 2022 · 0 comments
Open

Be more careful about signed/unsigned comparisons #335

terrillmoore opened this issue Jun 12, 2022 · 0 comments
Assignees
Labels

Comments

@terrillmoore
Copy link
Member

gcc -Wall complains about signed/unsigned comparisons. It doesn't hurt to fix these. It requires some verbosity, but isn't generally difficult, and it makes the code more proof-like. This ticket tracks those changes.

@terrillmoore terrillmoore self-assigned this Jun 12, 2022
terrillmoore added a commit that referenced this issue Jun 12, 2022
We had lots of errors due to our normal range checking; GCC
doesn't like when we say `if (0 <= v && v <= max)` if `v` is unsigned.
The more verbose way of getting the same effect is to add static
asserts using `std::numeric_limits()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant