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 #73172 #75953

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Fix #73172 #75953

merged 1 commit into from
Aug 27, 2024

Conversation

alef
Copy link
Contributor

@alef alef commented Aug 25, 2024

Summary

Bugfixes "Workaround gcc v11.4.0 bug"

Purpose of change

Avoid the compiler error reported in #73172

Describe the solution

Surround abstract_var_info with compiler pragmas to avoid checking for possibly use of uninitialized variables. The same code does not error with gcc v12 as tested on godbolt.org.

Describe alternatives you've considered

Testing

Built on WSL2 g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 and MSVC/CMake.

Additional context

Mush probably a gcc v11.4.0 bug
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 25, 2024
@kevingranade kevingranade merged commit 57c3b30 into CleverRaven:master Aug 27, 2024
26 of 29 checks passed
@andrei8l
Copy link
Contributor

This breaks compilation with clang. It should have been wrapped in #if defined(__GNUC__) && !defined(__clang__), like here

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
heap = static_cast<T *>( std::realloc( heap_, sizeof( T ) * new_capacity ) );
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

@kevingranade
Copy link
Member

On clang what? It built here with Clang 10, Clang 12, and Clang 14 on macOS.
I'm not saying you're wrong, but how did this make it through our build without catching the breakage?

@andrei8l
Copy link
Contributor

No, I am wrong. My failure is from -Wunknown-warning-option, which is disabled here by Wno-unknown-warning-option but not in my tree. Sorry...

@kevingranade
Copy link
Member

No problem. I thought I remembered that clang might not respect that in some circumstances.

False alarms are better than missed alarms...

@alef alef deleted the fix-73172 branch August 27, 2024 19:00
Knut-Aage-Hofseth pushed a commit to Knut-Aage-Hofseth/Cataclysm-DDA that referenced this pull request Aug 29, 2024
Mush probably a gcc v11.4.0 bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants