Skip to content

clear compiler warnings#3698

Merged
wyli merged 2 commits into
Project-MONAI:devfrom
wyli:fixes-compiler-warnings
Jan 24, 2022
Merged

clear compiler warnings#3698
wyli merged 2 commits into
Project-MONAI:devfrom
wyli:fixes-compiler-warnings

Conversation

@wyli

@wyli wyli commented Jan 21, 2022

Copy link
Copy Markdown
Contributor

Signed-off-by: Wenqi Li wenqil@nvidia.com

Description

clear warnings such as

/MONAI/monai/csrc/filtering/permutohedral/permutohedral_cpu.cpp:469:7: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
      delete newValue;
      ^
            []
/MONAI/monai/csrc/filtering/permutohedral/permutohedral_cpu.cpp:417:26: note: allocated with 'new[]' here
    scalar_t* newValue = new scalar_t[vd * hashTable.size()];

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli requested review from Nic-Ma, ericspod and rijobro January 23, 2022 21:09

@Nic-Ma Nic-Ma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.
But I am not familiar with our C++ extensions, better to have @charliebudd double confirm it.

Thanks.

@charliebudd charliebudd self-requested a review January 24, 2022 16:38
@tvercaut

Copy link
Copy Markdown
Member

I think it would be nicer to replace the c arrays by c++ objects (std::vector or std::array when possible). The current memory management seems brittle.

@wyli

wyli commented Jan 24, 2022

Copy link
Copy Markdown
Contributor Author

/build

@wyli wyli enabled auto-merge (squash) January 24, 2022 17:07
@wyli wyli merged commit c2018cf into Project-MONAI:dev Jan 24, 2022
wyli added a commit that referenced this pull request Feb 9, 2022
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
wyli added a commit that referenced this pull request Feb 9, 2022
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
wyli added a commit that referenced this pull request Feb 9, 2022
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli deleted the fixes-compiler-warnings branch April 27, 2022 22:35
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.

4 participants