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

filesys: replace goto by #else to omit compile warning #15711

Merged
merged 2 commits into from
Jan 25, 2025

Conversation

stefanbeller
Copy link
Contributor

When compiling on a system other than Linux, you get the warning:

[ 72%] Building CXX object src/CMakeFiles/luanti.dir/filesys.cpp.o
.../luanti/src/filesys.cpp:516:1: warning: unused label 'fallback' [-Wunused-label]
  516 | fallback:

Fix this by using an #else instead of a goto.

Add compact, short information about your PR for easier understanding:

  • Goal: reduce compiler warnings
  • How does the PR work?: recompiled without issue

I was unsure if I should have guarded the goto label with another #ifdef instead as I recall back in the day the #else not being as supported as the standard #ifdef. However I think it is a non-issue these days.

To do

This PR is Ready for Review.

When compiling on a system other than Linux, you get the warning:
```
[ 72%] Building CXX object src/CMakeFiles/luanti.dir/filesys.cpp.o
.../luanti/src/filesys.cpp:516:1: warning: unused label 'fallback' [-Wunused-label]
  516 | fallback:
```

Fix this by using an else instead of a goto
@appgurueu appgurueu added Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines One approval ✅ ◻️ Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements labels Jan 25, 2025
@sfan5 sfan5 merged commit 282c81f into luanti-org:master Jan 25, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements One approval ✅ ◻️ Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants