Skip to content

Compiling for iOS using Xcode 9 tool chain has lambda capture 'this' is not used error #773

Closed
@mobileben

Description

@mobileben

In http_client_asio.cpp I am getting this error:

error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
auto start_http_request_flow = [proxy_type, proxy_host, proxy_port AND_CAPTURE_MEMBER_FUNCTION_POINTERS](std::shared_ptr<asio_context> ctx)

Clang compiler also sets GNUC, so inevitably this get set

#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this

Currently I am doing this

#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || (__clang__ && __APPLE__)

As a work around. If this seems reasonable or if I should just drop the && __APPLE__, let me know.

I am currently updating the build process for iOS, so I plan on putting this change in that pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions