Mir

Merge lp:~vanvugt/mir/fix-1358625 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Kevin DuBois
Approved revision: no longer in the source branch.
Merged at revision: 1861
Proposed branch: lp:~vanvugt/mir/fix-1358625
Merge into: lp:mir
Diff against target: 14 lines (+4/-0)
1 file modified
examples/scroll.cpp (+4/-0)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1358625
Reviewer Review Type Date Requested Status
Kevin DuBois (community) Approve
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Abstain
Review via email: mp+231311@code.launchpad.net

Commit message

Fix build failure: "variable ‘rc’ set but not used" which happens in
release mode (NDEBUG is set). (LP: #1358625)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: mir_protobuf_wire.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:954] CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
Aborted (core dumped)

lp:1358698

~~~~

I'm not convinced that this is the best approach - looking at the example code I think the right answer could be:

#undef NDEBUG
#include <assert.h>

there is no error handling.

review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alan,
You make a good point. The absence of error handling with NDEBUG will just lead to more cryptic crashes. I'll fix as suggested.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/scroll.cpp'
2--- examples/scroll.cpp 2014-03-26 05:48:59 +0000
3+++ examples/scroll.cpp 2014-08-25 03:12:36 +0000
4@@ -19,6 +19,10 @@
5 #include "mir_toolkit/mir_client_library.h"
6 #include "graphics.h"
7
8+#ifdef NDEBUG
9+// We have no error handling so rely on assert() always being present.
10+#undef NDEBUG
11+#endif
12 #include <assert.h>
13 #include <signal.h>
14 #include <string.h>

Subscribers

People subscribed via source and target branches