Bug 220389

Summary: devel/sdl2pp: Fix warnings with clang 5.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (amdmi3)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 219139    
Attachments:
Description Flags
Fix clang 5.0.0 warnings in devel/sdl2pp none

Description Dimitry Andric freebsd_committer freebsd_triage 2017-06-30 17:33:38 UTC
Created attachment 183948 [details]
Fix clang 5.0.0 warnings in devel/sdl2pp

During an exp-run for the projects/clang500-import branch (bug 219139), it turned out that devel/rapidjson does not build with clang 5.0.0 [1]:

/wrkdirs/usr/ports/devel/sdl2pp/work/libSDL2pp-0.13.0/examples/audio_sine.cc:44:58: error: lambda capture 'samplerate' is not required to be captured for this use [-Werror,-Wunused-lambda-capture]
        AudioDevice dev(NullOpt, 0, spec, [&nsample, frequency, samplerate](Uint8* stream, int len) {
                                                                ^

This is a new warning from clang 5.0.0, and the port is compiled with -Werror.  'samplerate' is a const int, and it gets "upgraded" to a constexpr, making it implicitly available in the lambda.  Similarly, the frequency is a constant float, so if it is made constexpr, it can be removed from the capture list.

[1] http://package18.nyi.freebsd.org/data/headamd64PR219139-default/2017-05-22_13h01m42s/logs/errors/sdl2pp-0.13.0_1.log
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2017-07-12 12:30:48 UTC
Fixed with new upstream release.