Project

General

Profile

Actions

Bug #40052

closed

common: blobhash.h does not compile under Clang

Added by Thomas Johnson almost 5 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Compilation failure in Clang 8.0 due to the last [[fallthrough]] statement in the switch at blobhash.h:41:7. GCC seems to accept this extra attribute, while Clang rejects it.

The final [[fallthrough]] annotation Introduced by commit ec4065af4d7

gmake[2]: *** [src/CMakeFiles/common-objs.dir/build.make:116: src/CMakeFiles/common-objs.dir/mon/MonClient.cc.o] Error 1
In file included from /usr/home/ceph-build/ceph/src/mon/MonMap.cc:4:
In file included from /usr/home/ceph-build/ceph/src/mon/MonMap.h:28:
In file included from /usr/home/ceph-build/ceph/src/mon/mon_types.h:20:
In file included from /usr/home/ceph-build/ceph/src/include/Context.h:19:
In file included from /usr/home/ceph-build/ceph/src/common/dout.h:28:
In file included from /usr/home/ceph-build/ceph/src/common/ceph_context.h:36:
In file included from /usr/home/ceph-build/ceph/src/common/config_proxy.h:6:
In file included from /usr/home/ceph-build/ceph/src/common/config.h:23:
In file included from /usr/home/ceph-build/ceph/src/common/options.h:11:
In file included from /usr/home/ceph-build/ceph/src/msg/msg_types.h:24:
/usr/home/ceph-build/ceph/src/include/blobhash.h:41:7: error: fallthrough annotation does not directly precede switch label
      [[fallthrough]];
      ^
1 error generated.

Example here: https://en.cppreference.com/w/cpp/language/attributes/fallthrough

Actions #1

Updated by Thomas Johnson almost 5 years ago

Tested on FreeBSD 12 against clang 6.0.1 and 8.0.0

Actions #3

Updated by Nathan Cutler almost 5 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 28270
Actions #4

Updated by Sage Weil almost 3 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF