Skip to content

ignore unused parameter 'buf' warning - #283

Merged
tdegeus merged 3 commits into
xtensor-stack:masterfrom
peter-urban:explicitly_ignore_unused_parameter_warning
Mar 10, 2023
Merged

ignore unused parameter 'buf' warning#283
tdegeus merged 3 commits into
xtensor-stack:masterfrom
peter-urban:explicitly_ignore_unused_parameter_warning

Conversation

@peter-urban

@peter-urban peter-urban commented Sep 20, 2022

Copy link
Copy Markdown
Contributor

I included <xtensor-python/xtensor_type_caster_base.hpp> into my code to let pybind11 automatically convert xtensor xarrays to numpy arrays.

However I get two "-wunused-parameter warnings" which seem to be straightforward to fix :-)

@peter-urban

Copy link
Copy Markdown
Contributor Author

Not sure, but the appveyor fail seems to be unrelated to my pull request?

@tdegeus

tdegeus commented Mar 2, 2023

Copy link
Copy Markdown
Member

Thanks! You could also just remove the name buf from the argument. Is there any reason to keep it?

@peter-urban

peter-urban commented Mar 8, 2023

Copy link
Copy Markdown
Contributor Author

I don't understand the code well enough to propose such a change.

To me this looks like a dummy function (just just returns true) to implement a sort of interface (but I don't know which one).
Removing the variable could thus break this interface.

That said: If you have a better understanding of the code-base and you say that we can remove the argument, it is of cause not problem for me to adapt the PR :-)

@tdegeus tdegeus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I meant this

Comment thread include/xtensor-python/xtensor_type_caster_base.hpp Outdated
Comment thread include/xtensor-python/xtensor_type_caster_base.hpp Outdated
peter-urban and others added 2 commits March 10, 2023 09:44
@peter-urban
peter-urban requested a review from tdegeus March 10, 2023 08:48
@tdegeus
tdegeus merged commit 7cb644a into xtensor-stack:master Mar 10, 2023
@tdegeus

tdegeus commented Mar 10, 2023

Copy link
Copy Markdown
Member

Tanks!

@peter-urban
peter-urban deleted the explicitly_ignore_unused_parameter_warning branch February 3, 2026 08:55
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