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

[Helper] Fix warning in SelectableItem #5163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hugtalbot
Copy link
Contributor

ChatGPT helped me on this one, @alxbilger I really need your 👁️ on this simple one


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@hugtalbot hugtalbot added pr: fix Fix a bug pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request labels Dec 12, 2024
@hugtalbot hugtalbot requested a review from alxbilger December 12, 2024 11:16
@hugtalbot hugtalbot added this to the v25.06 milestone Dec 12, 2024
@alxbilger
Copy link
Contributor

@hugtalbot what was the warning?

@hugtalbot
Copy link
Contributor Author

hugtalbot commented Dec 18, 2024

expression result unused about the ...


/builds/workspace/sofa-framework/master/ubuntu_clang_default_release/src/Sofa/framework/Helper/src/sofa/helper/SelectableItem.h:250:77: warning: expression result unused [-Wunused-value]
        ((Derived::s_items[Is].key == key ? (result = Is, true) : false) || ...);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    ^
/builds/workspace/sofa-framework/master/ubuntu_clang_default_release/src/Sofa/framework/Helper/src/sofa/helper/SelectableItem.h:243:16: note: in instantiation of function template specialization 'sofa::helper::SelectableItem<TestSelectableItem>::findId_impl<0UL, 1UL>' requested here
        return findId_impl(key, std::make_index_sequence<numberOfItems()>{});
               ^
/builds/workspace/sofa-framework/master/ubuntu_clang_default_release/src/Sofa/framework/Helper/src/sofa/helper/SelectableItem.h:196:25: note: in instantiation of member function 'sofa::helper::SelectableItem<TestSelectableItem>::findId' requested here
        m_selected_id = findId(key);
                        ^
/builds/workspace/sofa-framework/master/ubuntu_clang_default_release/src/Sofa/framework/Helper/test/SelectableItem_test.cpp:78:9: note: in instantiation of member function 'sofa::helper::SelectableItem<TestSelectableItem>::operator=' requested here
    foo = key_small;
        ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants