project-slippi / Ishiiruka

GNU General Public License v2.0
330 stars 142 forks source link

fix: semver compilation on macOS Monterey #406

Closed rapito closed 1 year ago

rapito commented 1 year ago

I messed the other branch by doing a weird-ass rebase, just opened a new branch rq.

Prevent build warnings being treated as errors for unused variables on semver project. This is on on MacOS monterrrey 12.6.

There's a specific file that was updated on the semver project leaving a few variables unused that won't allow the compiler to continue unless these warnings are ignored.

inline void prerelease_version_validator(const string&, const char c) {
    bool res = false;
    for (const auto& r : allowed_prerel_id_chars) {
        res |= (c >= r.first && c <= r.second);
    }
    //if (!res)
    //  throw Parse_error("invalid character encountered: " + string(1, c));
}

In here, res is not used.

Alternatively the slippi codebase could either comply with prelease_version_validator expectations or update the method to a nop.

But honestly, I think it's not worth the hassle and ignoring the warnings should be fine just for this target.

swagtoy commented 1 year ago

This also fixes it on FreeBSD, which uses Clang to compile. Not a macOS thing, but a clang bug

Edit: Nevermind, it doesn't. We should remove the if(APPLE) check anyway