Skip to content

Fix warning for GCC 14 #3

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

Merged
merged 1 commit into from
May 17, 2024
Merged

Conversation

dhthwy
Copy link

@dhthwy dhthwy commented May 16, 2024

No description provided.

@myk002 myk002 changed the base branch from master to dfhack May 17, 2024 01:49
@myk002 myk002 merged commit 3a72e1c into DFHack:dfhack May 17, 2024
Comment on lines +436 to +448
#if defined(__GNUC__) && __GNUC__ > 13
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#endif

Value::Value(Value&& other) noexcept {
initBasic(nullValue);
swap(other);
}

#if defined(__GNUC__) && __GNUC__ > 13
#pragma GCC diagnostic pop
#endif
Copy link
Member

Choose a reason for hiding this comment

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

A thought: you might be able to avoid duplicating the second #if condition with

#pragma GCC diagnostic push
#if defined(__GNUC__) && __GNUC__ > 13
#pragma GCC diagnostic ignored "-Wuninitialized"
#endif

Value::Value(Value&& other) noexcept {
  initBasic(nullValue);
  swap(other);
}

#pragma GCC diagnostic pop

(I haven't checked whether this works as expected, so don't put too much effort into it)

I might have also gone with >= 14 here, but again, untested.

Copy link
Author

Choose a reason for hiding this comment

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

Yes. I agree the second #if isn't ideal. I'll try experimenting with that late weekend or after the weekend. Probably after the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants