Merge lp:~aacid/unity-mir/clang_build_fix into lp:unity-mir

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 121
Merged at revision: 122
Proposed branch: lp:~aacid/unity-mir/clang_build_fix
Merge into: lp:unity-mir
Diff against target: 12 lines (+1/-1)
1 file modified
src/modules/Unity/Application/desktopfilereader.cpp (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity-mir/clang_build_fix
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+190895@code.launchpad.net

Commit message

Bring the -1 ouside of the sizeof

Otherwise clang complains
    ../../../../../src/modules/Unity/Application/desktopfilereader.cpp:123:73: error: sizeof on pointer operation will return size of 'const char *' instead of 'const char [16]' [-Werror,-Wsizeof-array-decay]
            if (strncmp(buffer, "[Desktop Entry]", sizeof("[Desktop Entry]" - 1))) {
                                                          ~~~~~~~~~~~~~~~~~ ^
    1 error generated.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

Nice catch

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/desktopfilereader.cpp'
2--- src/modules/Unity/Application/desktopfilereader.cpp 2013-10-10 16:26:03 +0000
3+++ src/modules/Unity/Application/desktopfilereader.cpp 2013-10-14 09:23:03 +0000
4@@ -120,7 +120,7 @@
5
6 // Validate "magic key" (standard group header).
7 if (file.readLine(buffer, kBufferSize) != -1) {
8- if (strncmp(buffer, "[Desktop Entry]", sizeof("[Desktop Entry]" - 1))) {
9+ if (strncmp(buffer, "[Desktop Entry]", sizeof("[Desktop Entry]") - 1)) {
10 DLOG("not a desktop file");
11 return false;
12 }

Subscribers

People subscribed via source and target branches