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 on FreeBSD #426
Fix build on FreeBSD #426
Conversation
similar/main/object.cpp:1060:13: error: lambda capture 'vmobjptr' is not required to be captured for this use [-Werror,-Wunused-lambda-capture] auto l = [&vmobjptr, &r, &num_to_free](bool (*predicate)(const vcobjptr_t)) -> bool { ^ similar/main/object.cpp:1511:32: error: lambda capture 'vmobjptr' is not required to be captured for this use [-Werror,-Wunused-lambda-capture] const auto is_bad_kill = [&vmobjptr]{ ^
Update to 20190523. Upstream also changed its naming convention. Change mainainer to my @FreeBSD.org address. Sort USES, add USES=sdl tar:xz (tarball switched to xz). Add patches from dxx-rebirth/dxx-rebirth#426 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D20425 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@502814 35697150-7ecd-e111-bb59-0022644237b5
Update to 20190523. Upstream also changed its naming convention. Change mainainer to my @FreeBSD.org address. Sort USES, add USES=sdl tar:xz (tarball switched to xz). Add patches from dxx-rebirth/dxx-rebirth#426 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D20425
Update to 20190523. Upstream also changed its naming convention. Change mainainer to my @FreeBSD.org address. Sort USES, add USES=sdl tar:xz (tarball switched to xz). Add patches from dxx-rebirth/dxx-rebirth#426 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D20425 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@502814 35697150-7ecd-e111-bb59-0022644237b5
clang treats -Wunused as a request for -Wunused-lambda-capture, which is good, except that -Wunused-lambda-capture is overzealous. It should warn for captures that are not used in the body. It should not, but does, warn for captures which are used in the body when such captures are not required by the standard. Since 4 of the supported gcc versions require that capture, removing the capture is not an option at this point. Add a test to suppress the clang warning in this case, and hope that eventually clang will warn only for uses that are actually unused. This removes the need for parts of <#426> (by pkubaj).
pkubaj proposed extending the if/elif tree. This patch instead switches to a loop, which avoids repeating any strings and is cleaner to extend when another platform shows up needing normalization. Requested-by: pkubaj <#426>
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.
These changes break gcc before gcc-8. Rebirth supports gcc-4.9 and later.
@@ -578,7 +578,7 @@ void digi_sync_sounds() | |||
&s.volume, &s.pan, s.max_distance ); | |||
|
|||
} else if ( s.flags & SOF_LINK_TO_OBJ ) { | |||
const auto objp = [&vcobjptr, &s]{ | |||
const auto objp = [&s]{ |
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.
NAK. This line is required by <gcc-8. If this change is merged, <gcc-8 fail to build this file.
I will push a configure test to suppress the clang warning in this case, since it actively encourages the reader to break other compilers.
@@ -1057,7 +1057,7 @@ static void free_object_slots(uint_fast32_t num_used) | |||
|
|||
// Capture before num_to_free modified | |||
const auto &&r = partial_const_range(obj_list, num_to_free); | |||
auto l = [&vmobjptr, &r, &num_to_free](bool (*predicate)(const vcobjptr_t)) -> bool { | |||
auto l = [&r, &num_to_free](bool (*predicate)(const vcobjptr_t)) -> bool { |
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.
NAK, same problem as in the other commit. This capture is required for <gcc-8.
Thank you for the report. Several of the proposed changes cause problems elsewhere, so I resolved those differently. Please fetch and report whether the FreeBSD build now works for you without modification. |
Update to 20190523. Upstream also changed its naming convention. Change mainainer to my @FreeBSD.org address. Sort USES, add USES=sdl tar:xz (tarball switched to xz). Add patches from dxx-rebirth/dxx-rebirth#426 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D20425 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@502814 35697150-7ecd-e111-bb59-0022644237b5
I believe the changes I made above will address the problems that motivated this pull request. No further response from original poster. @pkubaj : please reopen if the FreeBSD build does not work for you with the changes I pushed. |
Update to 20190523. Upstream also changed its naming convention. Change mainainer to my @FreeBSD.org address. Sort USES, add USES=sdl tar:xz (tarball switched to xz). Add patches from dxx-rebirth/dxx-rebirth#426 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D20425
No description provided.