-
-
Notifications
You must be signed in to change notification settings - Fork 991
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 with musl libc #8628
fix build with musl libc #8628
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bug in the existing code - these std::optional
arguments should default to std::nullopt
. AFAICS, they're defaulting to values of zero instead. Going to have to read through #7923 and #7924 to work out exactly what they should do, how to expand the tests, and whether those arguments can change to just passing non-optional arguments instead.
Thanks for drawing attention to it, but as you can see from the length of discussion in #7924, it's not the easiest first issue to start with.
Having said that, the code in this PR may be a good change. I suspect the perfect fix will be to change the NULL
to 0
but also remove the std::optional wrappers.
Well I can try removing them and build it again, then change it in PR. Should I? |
Yes please. Sorry for the unclear previous message, still working out what to do. |
This patch builds fine and, as far as I can understand, it doesn't destroy logic behind ...matches_if_present... functions
Sorry if I'm wrong. And let me know if I am, plz. @stevecotton |
1bcc313
to
8e6d63c
Compare
8e6d63c
to
98492e1
Compare
Was this meant to be closed? |
NO SORRY |
Accidentally pushed empty commit |
6523c86
to
394eeea
Compare
Now build works and bug should no longer exist |
@newfrenchy83 would you review this PR please? |
Not that I'm happy to revert to the optionality of the default, but if it actually triggers a compilation problem then I'll accept it. |
@iFoundSilentHouse did you try compiling with std::nullopt instead of NULL, rather than forgoing std::optional? |
No. I didn't. |
@newfrenchy83 if NULL was always zero instead of being equivalent to nullopt, then I'm wondering if the optional things need to be optional at all. |
I had confused NULL with std::nullopt, hence the confusion, for me it is not a question of using NULLL as an equivalent of 0 |
Closing this PR in favor of more accurate #8649 |
Wesnoth was unable to build with musl.
Error message:
error: could not convert 'nullptr' from 'std::nullptr_t' to 'int'
It was for strings 43, 44, 65.
I found the same error but with other program: dotnet/runtime#67763
And after changing 'NULL' to '0' build was successful.