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

Fix build on FreeBSD #426

Closed
wants to merge 3 commits into from
Closed

Fix build on FreeBSD #426

wants to merge 3 commits into from

Conversation

pkubaj
Copy link
Contributor

@pkubaj pkubaj commented May 27, 2019

No description provided.

With Clang 6.0, I'm getting:
similar/main/digiobj.cpp:581:25: error: lambda capture 'vcobjptr' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
                const auto objp = [&vcobjptr, &s]{
                                    ^
1 error generated.
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]{
                                           ^
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request May 27, 2019
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
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request May 27, 2019
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
Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this pull request May 28, 2019
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
vLKp added a commit that referenced this pull request May 28, 2019
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).
vLKp added a commit that referenced this pull request May 28, 2019
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>
Copy link
Contributor

@vLKp vLKp left a 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]{
Copy link
Contributor

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 {
Copy link
Contributor

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.

@vLKp
Copy link
Contributor

vLKp commented May 28, 2019

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.

swills pushed a commit to swills/freebsd-ports that referenced this pull request May 28, 2019
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
@vLKp
Copy link
Contributor

vLKp commented Jun 2, 2019

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.

@vLKp vLKp closed this Jun 2, 2019
svmhdvn pushed a commit to svmhdvn/freebsd-ports that referenced this pull request Jan 10, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants