Mir

Merge lp:~raof/mir/the-compiler-warning-treadmill into lp:mir

Proposed by Chris Halse Rogers on 2017-05-25
Status: Merged
Approved by: Alan Griffiths on 2017-05-25
Approved revision: 4180
Merged at revision: 4174
Proposed branch: lp:~raof/mir/the-compiler-warning-treadmill
Merge into: lp:mir
Diff against target: 389 lines (+56/-9)
24 files modified
examples/client_helpers.h (+1/-0)
examples/server_example_canonical_window_manager.cpp (+1/-1)
include/common/mir/dispatch/action_queue.h (+1/-0)
include/common/mir/input/mir_input_config.h (+1/-0)
include/server/mir/input/input_device_hub.h (+1/-0)
src/client/mir_prompt_session.h (+1/-0)
src/client/rpc/mir_basic_rpc_channel.h (+1/-0)
src/include/common/mir/thread_safe_list.h (+1/-0)
src/include/platform/mir/udev/wrapper.h (+1/-0)
src/include/server/mir/input/scene.h (+1/-0)
src/include/server/mir/input/validator.h (+1/-0)
src/include/server/mir/scene/session_container.h (+1/-0)
src/platforms/mesa/server/kms/cursor.h (+1/-0)
src/platforms/mesa/server/kms/kms_output_container.h (+1/-0)
src/platforms/mesa/server/x11/graphics/egl_helper.h (+1/-0)
src/server/compositor/default_configuration.cpp (+1/-1)
src/server/graphics/nested/mir_client_host_connection.cpp (+1/-1)
src/server/shell/canonical_window_manager.cpp (+1/-1)
src/server/shell/default_configuration.cpp (+3/-0)
tests/acceptance-tests/test_client_cursor_api.cpp (+1/-1)
tests/acceptance-tests/test_custom_window_management.cpp (+20/-0)
tests/acceptance-tests/test_presentation_chain.cpp (+6/-2)
tests/acceptance-tests/test_prompt_session_client_api.cpp (+6/-2)
tests/unit-tests/scene/test_application_session.cpp (+2/-0)
To merge this branch: bzr merge lp:~raof/mir/the-compiler-warning-treadmill
Reviewer Review Type Date Requested Status
Alan Griffiths 2017-05-25 Approve on 2017-05-25
Mir CI Bot continuous-integration Approve on 2017-05-25
Review via email: mp+324593@code.launchpad.net

Commit message

Resolve all the new warnings available in Clang 5.0 and GCC 7.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4180
https://mir-jenkins.ubuntu.com/job/mir-ci/3409/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4637
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4769
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4758
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4758
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4669/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4669/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4669/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4669/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4669
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4669/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3409/rebuild

review: Approve (continuous-integration)
Alan Griffiths (alan-griffiths) wrote :

+ // fallthrough

Wow! Compiler reads comments!!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/client_helpers.h'
2--- examples/client_helpers.h 2017-05-19 09:51:35 +0000
3+++ examples/client_helpers.h 2017-05-25 05:10:00 +0000
4@@ -23,6 +23,7 @@
5 #include <EGL/egl.h>
6 #include <GLES2/gl2.h>
7 #include <memory>
8+#include <functional>
9
10 namespace mir
11 {
12
13=== modified file 'examples/server_example_canonical_window_manager.cpp'
14--- examples/server_example_canonical_window_manager.cpp 2017-05-08 03:04:26 +0000
15+++ examples/server_example_canonical_window_manager.cpp 2017-05-25 05:10:00 +0000
16@@ -711,7 +711,7 @@
17
18 case mir_touch_action_down:
19 is_drag = false;
20-
21+ // fallthrough
22 case mir_touch_action_change:
23 continue;
24
25
26=== modified file 'include/common/mir/dispatch/action_queue.h'
27--- include/common/mir/dispatch/action_queue.h 2015-06-17 05:20:42 +0000
28+++ include/common/mir/dispatch/action_queue.h 2017-05-25 05:10:00 +0000
29@@ -24,6 +24,7 @@
30
31 #include <list>
32 #include <mutex>
33+#include <functional>
34
35 namespace mir
36 {
37
38=== modified file 'include/common/mir/input/mir_input_config.h'
39--- include/common/mir/input/mir_input_config.h 2017-05-08 03:04:26 +0000
40+++ include/common/mir/input/mir_input_config.h 2017-05-25 05:10:00 +0000
41@@ -26,6 +26,7 @@
42 #include <vector>
43 #include <string>
44 #include <iosfwd>
45+#include <functional>
46
47 struct MirPointerConfig;
48 struct MirTouchpadConfig;
49
50=== modified file 'include/server/mir/input/input_device_hub.h'
51--- include/server/mir/input/input_device_hub.h 2017-05-08 03:04:26 +0000
52+++ include/server/mir/input/input_device_hub.h 2017-05-25 05:10:00 +0000
53@@ -20,6 +20,7 @@
54 #define MIR_INPUT_INPUT_DEVICE_HUB_H_
55
56 #include <memory>
57+#include <functional>
58
59 namespace mir
60 {
61
62=== modified file 'src/client/mir_prompt_session.h'
63--- src/client/mir_prompt_session.h 2017-05-08 03:04:26 +0000
64+++ src/client/mir_prompt_session.h 2017-05-25 05:10:00 +0000
65@@ -26,6 +26,7 @@
66 #include <mutex>
67 #include <memory>
68 #include <atomic>
69+#include <functional>
70
71 namespace mir
72 {
73
74=== modified file 'src/client/rpc/mir_basic_rpc_channel.h'
75--- src/client/rpc/mir_basic_rpc_channel.h 2017-05-08 03:04:26 +0000
76+++ src/client/rpc/mir_basic_rpc_channel.h 2017-05-25 05:10:00 +0000
77@@ -25,6 +25,7 @@
78 #include <atomic>
79 #include <vector>
80 #include <condition_variable>
81+#include <functional>
82
83 namespace google
84 {
85
86=== modified file 'src/include/common/mir/thread_safe_list.h'
87--- src/include/common/mir/thread_safe_list.h 2014-10-31 12:52:35 +0000
88+++ src/include/common/mir/thread_safe_list.h 2017-05-25 05:10:00 +0000
89@@ -23,6 +23,7 @@
90 #include "mir/recursive_read_write_mutex.h"
91
92 #include <atomic>
93+#include <functional>
94
95 namespace mir
96 {
97
98=== modified file 'src/include/platform/mir/udev/wrapper.h'
99--- src/include/platform/mir/udev/wrapper.h 2016-01-29 08:18:22 +0000
100+++ src/include/platform/mir/udev/wrapper.h 2017-05-25 05:10:00 +0000
101@@ -19,6 +19,7 @@
102 #ifndef MIR_UDEV_WRAPPER_H_
103 #define MIR_UDEV_WRAPPER_H_
104
105+#include <functional>
106 #include <memory>
107 #include <libudev.h>
108
109
110=== modified file 'src/include/server/mir/input/scene.h'
111--- src/include/server/mir/input/scene.h 2017-05-08 03:04:26 +0000
112+++ src/include/server/mir/input/scene.h 2017-05-25 05:10:00 +0000
113@@ -21,6 +21,7 @@
114 #define MIR_INPUT_INPUT_SCENE_H_
115
116 #include <memory>
117+#include <functional>
118
119 namespace mir
120 {
121
122=== modified file 'src/include/server/mir/input/validator.h'
123--- src/include/server/mir/input/validator.h 2017-05-08 03:04:26 +0000
124+++ src/include/server/mir/input/validator.h 2017-05-25 05:10:00 +0000
125@@ -25,6 +25,7 @@
126 #include <unordered_map>
127 #include <vector>
128 #include <mutex>
129+#include <functional>
130
131 namespace mir
132 {
133
134=== modified file 'src/include/server/mir/scene/session_container.h'
135--- src/include/server/mir/scene/session_container.h 2017-05-08 03:04:26 +0000
136+++ src/include/server/mir/scene/session_container.h 2017-05-25 05:10:00 +0000
137@@ -19,6 +19,7 @@
138 #ifndef MIR_SCENE_SESSION_CONTAINER_H_
139 #define MIR_SCENE_SESSION_CONTAINER_H_
140
141+#include <functional>
142 #include <vector>
143 #include <memory>
144 #include <mutex>
145
146=== modified file 'src/platforms/mesa/server/kms/cursor.h'
147--- src/platforms/mesa/server/kms/cursor.h 2017-05-08 03:04:26 +0000
148+++ src/platforms/mesa/server/kms/cursor.h 2017-05-25 05:10:00 +0000
149@@ -28,6 +28,7 @@
150
151 #include <gbm.h>
152
153+#include <functional>
154 #include <memory>
155 #include <mutex>
156
157
158=== modified file 'src/platforms/mesa/server/kms/kms_output_container.h'
159--- src/platforms/mesa/server/kms/kms_output_container.h 2017-05-08 03:04:26 +0000
160+++ src/platforms/mesa/server/kms/kms_output_container.h 2017-05-25 05:10:00 +0000
161@@ -21,6 +21,7 @@
162
163 #include <cstdint>
164 #include <memory>
165+#include <functional>
166
167 namespace mir
168 {
169
170=== modified file 'src/platforms/mesa/server/x11/graphics/egl_helper.h'
171--- src/platforms/mesa/server/x11/graphics/egl_helper.h 2017-05-08 03:04:26 +0000
172+++ src/platforms/mesa/server/x11/graphics/egl_helper.h 2017-05-25 05:10:00 +0000
173@@ -20,6 +20,7 @@
174 #define MIR_GRAPHICS_X11_EGL_HELPER_H_
175
176 #include <memory>
177+#include <functional>
178
179 #include <X11/Xlib.h>
180 #include <EGL/egl.h>
181
182=== modified file 'src/server/compositor/default_configuration.cpp'
183--- src/server/compositor/default_configuration.cpp 2017-05-08 03:04:26 +0000
184+++ src/server/compositor/default_configuration.cpp 2017-05-25 05:10:00 +0000
185@@ -39,7 +39,7 @@
186 mir::DefaultServerConfiguration::the_buffer_stream_factory()
187 {
188 return buffer_stream_factory(
189- [this]()
190+ []()
191 {
192 return std::make_shared<mc::BufferStreamFactory>();
193 });
194
195=== modified file 'src/server/graphics/nested/mir_client_host_connection.cpp'
196--- src/server/graphics/nested/mir_client_host_connection.cpp 2017-05-08 03:04:26 +0000
197+++ src/server/graphics/nested/mir_client_host_connection.cpp 2017-05-25 05:10:00 +0000
198@@ -423,7 +423,7 @@
199 delete surf;
200 });
201
202- if (stored_cursor_image.size().width.as_int() * stored_cursor_image.size().height.as_int())
203+ if (stored_cursor_image.size().width.as_int() && stored_cursor_image.size().height.as_int())
204 surf->set_cursor_image(stored_cursor_image);
205
206 surfaces.push_back(surf.get());
207
208=== modified file 'src/server/shell/canonical_window_manager.cpp'
209--- src/server/shell/canonical_window_manager.cpp 2017-05-08 03:04:26 +0000
210+++ src/server/shell/canonical_window_manager.cpp 2017-05-25 05:10:00 +0000
211@@ -695,7 +695,7 @@
212
213 case mir_touch_action_down:
214 is_drag = false;
215-
216+ // fallthrough
217 case mir_touch_action_change:
218 continue;
219
220
221=== modified file 'src/server/shell/default_configuration.cpp'
222--- src/server/shell/default_configuration.cpp 2016-07-01 20:32:34 +0000
223+++ src/server/shell/default_configuration.cpp 2017-05-25 05:10:00 +0000
224@@ -52,10 +52,13 @@
225
226 auto mir::DefaultServerConfiguration::the_window_manager_builder() -> shell::WindowManagerBuilder
227 {
228+#pragma GCC diagnostic push
229+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
230 return [this](msh::FocusController* focus_controller)
231 { return std::make_shared<msh::CanonicalWindowManager>(
232 focus_controller,
233 the_shell_display_layout()); };
234+#pragma GCC diagnostic pop
235 }
236
237 auto mir::DefaultServerConfiguration::wrap_shell(std::shared_ptr<msh::Shell> const& wrapped) -> std::shared_ptr<msh::Shell>
238
239=== modified file 'tests/acceptance-tests/test_client_cursor_api.cpp'
240--- tests/acceptance-tests/test_client_cursor_api.cpp 2017-05-08 03:04:26 +0000
241+++ tests/acceptance-tests/test_client_cursor_api.cpp 2017-05-25 05:10:00 +0000
242@@ -461,11 +461,11 @@
243 #pragma GCC diagnostic push
244 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
245 using PlacementWindowManager = msh::WindowManagerConstructor<mtf::DeclarativePlacementWindowManagerPolicy>;
246-#pragma GCC diagnostic pop
247 return std::make_shared<PlacementWindowManager>(
248 focus_controller,
249 client_geometries,
250 server.the_shell_display_layout());
251+#pragma GCC diagnostic pop
252 });
253
254 server.wrap_shell([&, this](auto const& wrapped)
255
256=== modified file 'tests/acceptance-tests/test_custom_window_management.cpp'
257--- tests/acceptance-tests/test_custom_window_management.cpp 2017-05-08 03:04:26 +0000
258+++ tests/acceptance-tests/test_custom_window_management.cpp 2017-05-25 05:10:00 +0000
259@@ -472,23 +472,33 @@
260
261 EXPECT_TRUE(params.placement_hints.is_set());
262 if (params.placement_hints.is_set())
263+ {
264 EXPECT_THAT(params.placement_hints.value(), Eq(placement_hints));
265+ }
266
267 EXPECT_TRUE(params.surface_placement_gravity.is_set());
268 if (params.surface_placement_gravity.is_set())
269+ {
270 EXPECT_THAT(params.surface_placement_gravity.value(), Eq(surface_gravity));
271+ }
272
273 EXPECT_TRUE(params.aux_rect_placement_gravity.is_set());
274 if (params.aux_rect_placement_gravity.is_set())
275+ {
276 EXPECT_THAT(params.aux_rect_placement_gravity.value(), Eq(rect_gravity));
277+ }
278
279 EXPECT_TRUE(params.aux_rect_placement_offset_x.is_set());
280 if (params.aux_rect_placement_offset_x.is_set())
281+ {
282 EXPECT_THAT(params.aux_rect_placement_offset_x.value(), Eq(offset_dx));
283+ }
284
285 EXPECT_TRUE(params.aux_rect_placement_offset_y.is_set());
286 if (params.aux_rect_placement_offset_y.is_set())
287+ {
288 EXPECT_THAT(params.aux_rect_placement_offset_y.value(), Eq(offset_dy));
289+ }
290
291 received.raise();
292 return build(session, params);
293@@ -561,23 +571,33 @@
294
295 EXPECT_TRUE(spec.placement_hints.is_set());
296 if (spec.placement_hints.is_set())
297+ {
298 EXPECT_THAT(spec.placement_hints.value(), Eq(placement_hints));
299+ }
300
301 EXPECT_TRUE(spec.surface_placement_gravity.is_set());
302 if (spec.surface_placement_gravity.is_set())
303+ {
304 EXPECT_THAT(spec.surface_placement_gravity.value(), Eq(surface_gravity));
305+ }
306
307 EXPECT_TRUE(spec.aux_rect_placement_gravity.is_set());
308 if (spec.aux_rect_placement_gravity.is_set())
309+ {
310 EXPECT_THAT(spec.aux_rect_placement_gravity.value(), Eq(rect_gravity));
311+ }
312
313 EXPECT_TRUE(spec.aux_rect_placement_offset_x.is_set());
314 if (spec.aux_rect_placement_offset_x.is_set())
315+ {
316 EXPECT_THAT(spec.aux_rect_placement_offset_x.value(), Eq(offset_dx));
317+ }
318
319 EXPECT_TRUE(spec.aux_rect_placement_offset_y.is_set());
320 if (spec.aux_rect_placement_offset_y.is_set())
321+ {
322 EXPECT_THAT(spec.aux_rect_placement_offset_y.value(), Eq(offset_dy));
323+ }
324
325 received.raise();
326 };
327
328=== modified file 'tests/acceptance-tests/test_presentation_chain.cpp'
329--- tests/acceptance-tests/test_presentation_chain.cpp 2017-05-08 03:04:26 +0000
330+++ tests/acceptance-tests/test_presentation_chain.cpp 2017-05-25 05:10:00 +0000
331@@ -360,7 +360,9 @@
332 buffer_callback, &contexts[i % num_buffers]);
333 contexts[i % num_buffers].unavailable();
334 if (i != 0)
335- ASSERT_TRUE(contexts[(i-1) % num_buffers].wait_for_buffer(10s)) << "iteration " << i;
336+ {
337+ ASSERT_TRUE(contexts[(i - 1) % num_buffers].wait_for_buffer(10s)) << "iteration " << i;
338+ }
339 }
340
341 for (auto& context : contexts)
342@@ -588,7 +590,9 @@
343 {
344 buffers[i]->submit_to(window.chain());
345 if (i > 0)
346- EXPECT_TRUE(buffers[i-1]->wait_ready(5s));
347+ {
348+ EXPECT_TRUE(buffers[i - 1]->wait_ready(5s));
349+ }
350 }
351
352 for(auto i = 0u; i < num_buffers - 1; i++)
353
354=== modified file 'tests/acceptance-tests/test_prompt_session_client_api.cpp'
355--- tests/acceptance-tests/test_prompt_session_client_api.cpp 2017-05-08 03:04:26 +0000
356+++ tests/acceptance-tests/test_prompt_session_client_api.cpp 2017-05-25 05:10:00 +0000
357@@ -715,12 +715,16 @@
358 int socket_fd[size];
359 int const opt = 1;
360
361- assert(socketpair(AF_LOCAL, SOCK_STREAM, 0, socket_fd) == 0);
362+ // Mark this as maybe-unused, as it's only used in an assert()
363+ [[gnu::unused]] auto const socketpair_succeded = socketpair(AF_LOCAL, SOCK_STREAM, 0, socket_fd);
364+ assert(socketpair_succeded == 0);
365
366 char const msg[] = "A random message";
367 send(socket_fd[client], msg, sizeof msg, MSG_DONTWAIT | MSG_NOSIGNAL);
368
369- assert(setsockopt(socket_fd[server], SOL_SOCKET, SO_PASSCRED, &opt, sizeof(opt)) != -1);
370+ // Mark this as maybe-unused, as it's only used in an assert()
371+ [[gnu::unused]] auto const setsockopt_succeded = setsockopt(socket_fd[server], SOL_SOCKET, SO_PASSCRED, &opt, sizeof(opt));
372+ assert(setsockopt_succeded != -1);
373
374 union {
375 struct cmsghdr cmh;
376
377=== modified file 'tests/unit-tests/scene/test_application_session.cpp'
378--- tests/unit-tests/scene/test_application_session.cpp 2017-05-08 03:04:26 +0000
379+++ tests/unit-tests/scene/test_application_session.cpp 2017-05-25 05:10:00 +0000
380@@ -439,7 +439,9 @@
381 surf[i] = app_session->surface(id[i]);
382
383 if (i > 0)
384+ {
385 ASSERT_NE(surf[i], surf[i-1]);
386+ }
387 }
388
389 for (int i = 0; i < N-1; ++i)

Subscribers

People subscribed via source and target branches