Skip to content

Commit ef8ed46

Browse files
committed
enabled and fixed -Wcovered-switch-default Clang warnings
1 parent df927d5 commit ef8ed46

6 files changed

Lines changed: 0 additions & 11 deletions

File tree

cmake/compileroptions.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
136136
add_compile_options_safe(-Wno-unused-exception-parameter)
137137
add_compile_options_safe(-Wno-sign-conversion)
138138
add_compile_options_safe(-Wno-shadow-field-in-constructor)
139-
add_compile_options_safe(-Wno-covered-switch-default)
140139
add_compile_options_safe(-Wno-shorten-64-to-32)
141140
add_compile_options_safe(-Wno-implicit-int-conversion)
142141
add_compile_options_safe(-Wno-double-promotion)

gui/checkstatistics.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ void CheckStatistics::addItem(const QString &tool, ShowTypes::ShowType type)
5959
::addItem(mInformation, lower);
6060
break;
6161
case ShowTypes::ShowNone:
62-
default:
6362
qDebug() << "Unknown error type - not added to statistics.";
6463
break;
6564
}
@@ -99,7 +98,6 @@ unsigned CheckStatistics::getCount(const QString &tool, ShowTypes::ShowType type
9998
case ShowTypes::ShowInformation:
10099
return mInformation.value(lower,0);
101100
case ShowTypes::ShowNone:
102-
default:
103101
qDebug() << "Unknown error type - returning zero statistics.";
104102
return 0;
105103
}

gui/mainwindow.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,9 +1016,6 @@ bool MainWindow::tryLoadLibrary(Library &library, const QString& filename)
10161016
case Library::ErrorCode::UNKNOWN_ELEMENT:
10171017
errmsg = tr("Unknown element");
10181018
break;
1019-
default:
1020-
errmsg = tr("Unknown issue");
1021-
break;
10221019
}
10231020
if (!error.reason.empty())
10241021
errmsg += " '" + QString::fromStdString(error.reason) + "'";

gui/resultstree.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ QString ResultsTree::severityToTranslatedString(Severity severity)
377377
return tr("internal");
378378

379379
case Severity::none:
380-
default:
381380
return QString();
382381
}
383382
}

lib/platform.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ class CPPCHECKLIB Platform {
194194
return "unix64";
195195
case Type::File:
196196
return "platformFile";
197-
default:
198-
throw std::runtime_error("unknown platform");
199197
}
200198
}
201199

lib/symboldatabase.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4065,8 +4065,6 @@ static const char* functionTypeToString(FunctionType type)
40654065
return "Function";
40664066
case FunctionType::eLambda:
40674067
return "Lambda";
4068-
default:
4069-
return "Unknown";
40704068
}
40714069
}
40724070

0 commit comments

Comments
 (0)