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

fix build for gcc 14 #3391

Closed
wants to merge 2 commits into from
Closed

Conversation

AiraYumi
Copy link
Contributor

@AiraYumi AiraYumi commented Jan 10, 2025

Fix build error for gcc 14

It has not yet been completely fixed.
There may be some false positives.

@github-actions github-actions bot added the c/cpp label Jan 10, 2025
Copy link
Collaborator

@nat-goodspeed nat-goodspeed left a comment

Choose a reason for hiding this comment

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

I'll run the builds and we'll see.

@@ -1979,7 +1979,7 @@ void LLPanelRegionTerrainInfo::initMaterialCtrl(LLTextureCtrl*& ctrl, const std:
if (!ctrl) return;

// consume cancel events, otherwise they will trigger commit callbacks
ctrl->setOnCancelCallback([](LLUICtrl* ctrl, const LLSD& param) {});
ctrl->setOnCancelCallback([this](LLUICtrl* ctrl, const LLSD& param) {});
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change makes me raise my eyebrows. I can't think of a reason why a lambda with a literally empty body would need any bindings.

Copy link
Contributor

Choose a reason for hiding this comment

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

It makes no sense in all of the changes in this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In fact, clang actively dislikes it:

/Users/runner/work/viewer/viewer/indra/newview/llinventorygallerymenu.cpp:329:85: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  329 |             boost::function<void(std::string& slurl)> copy_slurl_to_clipboard_cb = [this](const std::string& slurl)
      |                                                                                     ^~~~
1 error generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gcc14 marks all changes as errors. Maybe all the errors it detects are false positives.
I was not able to build the viewer properly using gcc14 and gcc13 in my environment.

@AiraYumi
Copy link
Contributor Author

gcc 14 or 13 error list

  • dangling−pointer
  • maybe uninitialized
  • uninitialized

@nat-goodspeed
Copy link
Collaborator

Maybe we must tell gcc users to skip versions 13 and 14? We certainly can't accept changes that break clang builds.

@AiraYumi
Copy link
Contributor Author

Skipping gcc 13 and 14 may be appropriate.
The default for ubuntu24.04 is gcc13. The default for gentoo (ubuntu24.10) is gcc14.
Documentation for users who are using it may be needed.

@AiraYumi
Copy link
Contributor Author

AiraYumi commented Jan 15, 2025

Since there is no prospect of being able to build with gcc13 and 14, I am thinking of canceling this PR. What do you think?

@nat-goodspeed
Copy link
Collaborator

I have to agree. I can't think of a cleaner way to pacify gcc 13 and 14 while preserving the ability to build with clang and others than something like:

#if <gcc13> or <gcc14>  // whatever tests we use for that
#define GCC13THIS this
#else  // everybody else
#define GCC13THIS
#endif // not gcc13 or gcc14
// ...
auto callback = [GCC13THIS](...){ ... };

which is still pretty ugly.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants