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

cmake: enable Wextra #2542

Merged
merged 1 commit into from
Dec 4, 2023
Merged

cmake: enable Wextra #2542

merged 1 commit into from
Dec 4, 2023

Conversation

Riolku
Copy link
Contributor

@Riolku Riolku commented Dec 4, 2023

Primarily these warnings fall into two categories:

  • Unused parameter (that clang-tidy didn't catch).
  • Mismatch sign comparison. Generally this happens in loops, and the correct fix is auto i = 0u. This gives i the type of unsigned, and so we must be careful that i cannot overflow 2^32.

Wextra is disabled when building third_party code.

@Riolku Riolku force-pushed the enable-wextra branch 4 times, most recently from cce53ae to 040902f Compare December 4, 2023 22:14
Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (47a50c1) 92.85% compared to head (2b32121) 92.85%.
Report is 1 commits behind head on master.

❗ Current head 2b32121 differs from pull request most recent head 8648a9e. Consider uploading reports for the commit 8648a9e to get more accurate results

Files Patch % Lines
src/include/function/path/path_function_executor.h 60.00% 2 Missing ⚠️
src/storage/store/column.cpp 33.33% 2 Missing ⚠️
src/include/binder/bound_statement_visitor.h 94.73% 1 Missing ⚠️
src/include/parser/expression/parsed_expression.h 0.00% 1 Missing ⚠️
src/include/storage/wal/wal_record.h 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2542   +/-   ##
=======================================
  Coverage   92.85%   92.85%           
=======================================
  Files        1025     1025           
  Lines       38338    38323   -15     
=======================================
- Hits        35598    35585   -13     
+ Misses       2740     2738    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -256,7 +256,7 @@ void ArrowRowBatch::templateCopyNonNullValue<LogicalTypeID::VAR_LIST>(
auto numBytesForChildValidity = getNumBytesForBits(numChildElements);
vector->childData[0]->validity.resize(numBytesForChildValidity);
// Initialize validity mask which is used to mark each value is valid (non-null) or not (null).
for (auto i = currentNumBytesForChildValidity; i < numBytesForChildValidity; i++) {
for (int64_t i = currentNumBytesForChildValidity; i < numBytesForChildValidity; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little confused here. What is the warning message we got before? I think numBytesForChildValidity is a uint type, why do we make i as int64_t rather than uint64_t?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numBytesForChildValidity is a int64_t.

@@ -104,8 +104,9 @@ void PyConnection::getAllEdgesForTorchGeometric(py::array_t<int64_t>& npArray,
auto dstBuffer = buffer + numRels;
for (int64_t batch = 0; batch < batches; ++batch) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the batch number must be a non-negative number, should we make it an unsigned int?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably - I've made a small edit to address this, and added a comment for why start and end are int64_t.

Primarily these warnings fall into two categories:
- Unused parameter (that clang-tidy didn't catch).
- Mismatch sign comparison. Generally this happens in loops, and the
  correct fix is `auto i = 0u`. This gives `i` the type of `unsigned`,
  and so we must be careful that `i` cannot overflow 2^32.

Wextra is disabled when building third_party code.
@Riolku Riolku merged commit a00a72a into master Dec 4, 2023
12 checks passed
@Riolku Riolku deleted the enable-wextra branch December 4, 2023 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants