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

[c++] Fix a compiler warning #3310

Merged
merged 1 commit into from
Nov 7, 2024
Merged

[c++] Fix a compiler warning #3310

merged 1 commit into from
Nov 7, 2024

Conversation

johnkerl
Copy link
Member

@johnkerl johnkerl commented Nov 7, 2024

Issue and/or context: As tracked on issue #2407 / [sc-51048].

Changes:

Fix a compiler warning:

/home/ubuntu/git/single-cell-data/TileDB-SOMA/libtiledbsoma/test/common.cc: In function ‘std::unique_ptr<ArrowSchema> helper::create_index_cols_info_schema(const std::vector<DimInfo>&)’:
/home/ubuntu/git/single-cell-data/TileDB-SOMA/libtiledbsoma/test/common.cc:156:26: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
  156 |     for (size_t i = 0; i < schema->n_children; ++i) {

Notes for Reviewer:

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.50%. Comparing base (208c0ab) to head (5e97880).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3310      +/-   ##
==========================================
+ Coverage   85.37%   85.50%   +0.12%     
==========================================
  Files          52       52              
  Lines        5499     5506       +7     
==========================================
+ Hits         4695     4708      +13     
+ Misses        804      798       -6     
Flag Coverage Δ
python 85.50% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 85.50% <85.71%> (+0.12%) ⬆️
libtiledbsoma ∅ <ø> (∅)

@@ -153,7 +153,7 @@ std::unique_ptr<ArrowSchema> create_index_cols_info_schema(

auto schema = ArrowAdapter::make_arrow_schema(names, tiledb_datatypes);

for (size_t i = 0; i < schema->n_children; ++i) {
for (size_t i = 0; i < (size_t)schema->n_children; ++i) {
Copy link
Member

@bkmartinjr bkmartinjr Nov 7, 2024

Choose a reason for hiding this comment

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

I don't mean to nitpick, but:

  • do we encourage use of C-style (legacy) casts, vs say a static_cast<>?
  • if schema->n_children is signed, alternative might just be to make i signed?
    either works for me...

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @bkmartinjr !

Copy link
Member

@bkmartinjr bkmartinjr left a comment

Choose a reason for hiding this comment

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

approving, but left comments on possible improvement

@johnkerl johnkerl merged commit bdaef58 into main Nov 7, 2024
15 checks passed
@johnkerl johnkerl deleted the kerl/fix-a-warning branch November 7, 2024 23:02
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