[Openmp-dev] default label in switch which covers all enumeration values

Jack Howarth howarth.mailing.lists at gmail.com
Thu Jun 4 17:45:43 PDT 2015


Jonathan,
      In current openmp, I noticed the following warning....

/sw/src/fink.build/llvm37-3.7.0-100/llvm-3.7.0.src/projects/openmp/runtime/src/kmp_lock.cpp:3596:9:
warning: default label in switch which covers all enumeration values
      [-Wcovered-switch-default]
        default:
        ^

The clang warning is described at...

http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations

Also, shouldn't the default case be at the end of the switch statement?

void __kmp_set_user_lock_vptrs( kmp_lock_kind_t user_lock_kind )
{
    switch ( user_lock_kind ) {
        case lk_default:
        default:
        KMP_ASSERT( 0 );

        case lk_tas: {


              Jack



More information about the Openmp-dev mailing list