Add cppcoreguidelines-pro-bounds-pointer-arithmetic clang-tidy check

Suppress a few warnings where pointer arithmetic is unavoidable.
This commit is contained in:
Oliver Hamlet
2022-02-07 00:15:57 +00:00
parent 2ad681b9f2
commit e091c90b17
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -492,6 +492,7 @@ if(RUN_CLANG_TIDY)
"cppcoreguidelines-narrowing-conventions"
"cppcoreguidelines-no-malloc"
"cppcoreguidelines-pro-bounds-constant-array-index"
"cppcoreguidelines-pro-bounds-pointer-arithmetic"
"cppcoreguidelines-pro-type-const-cast"
"cppcoreguidelines-pro-type-cstyle-cast"
"cppcoreguidelines-pro-type-reinterpret-cast"
+3
View File
@@ -123,6 +123,7 @@ std::vector<std::string> LoadOrderHandler::GetLoadOrder() const {
HandleError("get the load order", ret);
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
std::vector<string> loadOrder(pluginArr, pluginArr + pluginArrSize);
lo_free_string_array(pluginArr, pluginArrSize);
@@ -142,6 +143,7 @@ std::vector<std::string> LoadOrderHandler::GetActivePlugins() const {
HandleError("get active plugins", ret);
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
std::vector<string> loadOrder(pluginArr, pluginArr + pluginArrSize);
lo_free_string_array(pluginArr, pluginArrSize);
@@ -162,6 +164,7 @@ std::vector<std::string> LoadOrderHandler::GetImplicitlyActivePlugins() const {
HandleError("get implicitly active plugins", ret);
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
std::vector<string> loadOrder(pluginArr, pluginArr + pluginArrSize);
lo_free_string_array(pluginArr, pluginArrSize);
+1
View File
@@ -118,6 +118,7 @@ std::vector<std::string> Plugin::GetMasters() const {
" : esplugin error code: " + std::to_string(ret));
}
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
std::vector<std::string> mastersVec(masters, masters + numMasters);
esp_string_array_free(masters, numMasters);