Bug 220389 - devel/sdl2pp: Fix warnings with clang 5.0.0
Summary: devel/sdl2pp: Fix warnings with clang 5.0.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks: 219139
  Show dependency treegraph
 
Reported: 2017-06-30 17:33 UTC by Dimitry Andric
Modified: 2017-07-12 12:30 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (amdmi3)


Attachments
Fix clang 5.0.0 warnings in devel/sdl2pp (1.53 KB, patch)
2017-06-30 17:33 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 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 2017-07-12 12:30:48 UTC
Fixed with new upstream release.