-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Prefer signed types, and remove -Wall -Wextra warnings #2723
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
base: main
Are you sure you want to change the base?
Conversation
| const Allocator& allocator = Allocator()) | ||
| : allocator_(allocator) { | ||
| if (init.size() > capacity()) { | ||
| if (static_cast<int>(init.size()) > capacity()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it use std:ssize to match the style of other code?
| // Get the value out of it: | ||
| auto s = x.item<float>(); | ||
| assert(s == 1.0); | ||
| (void)s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++17 has a [[maybe_unused]] for this purpose.
https://en.cppreference.com/w/cpp/language/attributes/maybe_unused.html
|
|
||
| private: | ||
| // Grows the backing store by a factor of two, and at least to {min_capacity}. | ||
| // TODO: Move to private after removing external code using this method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR but since it is adjacent to your changes can you help delete this line? It is a finished TODO that I forgot to remove.
| VERSION ${MLX_PROJECT_VERSION}) | ||
|
|
||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") | ||
| add_compile_options(-Wall -Wextra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved to the # ---- Lib ---- section below.
Proposed changes
arrayclass prefersint64_tinstead ofsize_tSmallVectoris inherently small -- sizes are nowintChecklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes