Project

General

Profile

Cleanup #9756

Issues found by Clang

Added by Daniel Hofmann over 9 years ago. Updated over 8 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

I again [1] used Clang with -Weverything [2] to compile the Ceph repository [3].
There is still a huge amount of serious issues reported by Clang.
Even new ones that were only found by the nightly Clang version I used.

-Wtautological-constant-out-of-range-compare:

-Wembedded-directive:

-Wvarargs:

-Wuninitialized:

There is even more, such as Wshift-sign-overflow, Wsign-compare, etc. that are just too many to list here. And I discovered those just with Clang's warnings -- this is not even using the Static Analyzer, which warns about various other issues I do not have the time to go through.

Could you please not only fix those issues but also incorporate Clang / Static Analyzer into your toolchain? I'm not heavily involved in Ceph's codebase as I'm mostly a user that compiles the repo every other month mostly for the fun of it.

Thanks,
Daniel

[1] http://thread.gmane.org/gmane.comp.file-systems.ceph.devel/19507
[2] clang version 3.6.0-svn219050-1~exp1 (trunk) (based on LLVM 3.6.0)
[3] https://github.com/ceph/ceph/tree/158381e95d14e05e187b025c73522cbec42e88b4

Associated revisions

Revision 7250db62 (diff)
Added by Nathan Cutler over 8 years ago

CephxServiceHandler.cc: fix get_auth conditional

The KeyServer class has a public method get_auth() that returns a boolean
value. This value is being checked here - fix the conditional so it triggers
when get_auth() returns false.

http://tracker.ceph.com/issues/9756 References: #9756

Signed-off-by: Nathan Cutler <>

Revision 31b7864b (diff)
Added by Nathan Cutler over 8 years ago

CephxServiceHandler.cc: fix get_auth conditional

The KeyServer class has a public method get_auth() that returns a boolean
value. This value is being checked here - fix the conditional so it triggers
when get_auth() returns false.

http://tracker.ceph.com/issues/9756 References: #9756

Signed-off-by: Nathan Cutler <>
(cherry picked from commit 7250db62cb7ac1e9c0b1f5956d60b9d874496702)

History

#1 Updated by Sage Weil over 9 years ago

start with

https://github.com/ceph/autobuild-ceph/blob/master/build-ceph.sh

and make a build-ceph-clang.sh. then update build-auto.sh to have a clang case (in the hostname) and then it will be pretty trivial to add this to the gitbuilder list at

http://ceph.com/gitbuilders.cgi

of course, the real work is in cleaning up all the existing issues!

#2 Updated by Nathan Cutler over 8 years ago

  • Status changed from New to In Progress

https://github.com/ceph/ceph/pull/6090 attempts to fix the -Wtautological-constant-out-of-range-compare

#3 Updated by Kefu Chai over 8 years ago

#4 Updated by Nathan Cutler over 8 years ago

Subtask for -Wtautological-constant-out-of-range-compare is #13424, hammer backport is #13425.

Also available in: Atom PDF