diff options
-rw-r--r-- | .clang-tidy | 2 | ||||
-rw-r--r-- | include/lv2/atom/util.h | 6 | ||||
-rw-r--r-- | include/lv2/core/lv2_util.h | 2 | ||||
-rw-r--r-- | include/lv2/log/logger.h | 8 | ||||
-rw-r--r-- | meson/suppressions/meson.build | 19 | ||||
-rw-r--r-- | plugins/.clang-tidy | 1 | ||||
-rw-r--r-- | plugins/eg-params.lv2/state_map.h | 2 | ||||
-rw-r--r-- | test/headers/.clang-tidy | 2 | ||||
-rw-r--r-- | test/headers/meson.build | 6 |
9 files changed, 35 insertions, 13 deletions
diff --git a/.clang-tidy b/.clang-tidy index 8cb662d..5dc550b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -5,11 +5,13 @@ Checks: > *, -*-magic-numbers, -altera-*, + -bugprone-assignment-in-if-condition, -bugprone-easily-swappable-parameters, -bugprone-macro-parentheses, -clang-diagnostic-unused-function, -clang-diagnostic-unused-macros, -llvmlibc-restrict-system-libc-headers, + -modernize-macro-to-enum, -performance-no-int-to-ptr, -readability-identifier-length, CheckOptions: diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h index 3f78e41..f641619 100644 --- a/include/lv2/atom/util.h +++ b/include/lv2/atom/util.h @@ -356,7 +356,7 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...) int n_queries = 0; /* Count number of keys so we can short-circuit when done */ - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, body); for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { if (!va_arg(args, const LV2_Atom**)) { @@ -411,7 +411,7 @@ lv2_atom_object_get(const LV2_Atom_Object* object, ...) int n_queries = 0; /* Count number of keys so we can short-circuit when done */ - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, object); for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { if (!va_arg(args, const LV2_Atom**)) { @@ -467,7 +467,7 @@ lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...) int n_queries = 0; /* Count number of keys so we can short-circuit when done */ - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, object); for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { if (!va_arg(args, const LV2_Atom**) || !va_arg(args, uint32_t)) { diff --git a/include/lv2/core/lv2_util.h b/include/lv2/core/lv2_util.h index 167e263..69b92e5 100644 --- a/include/lv2/core/lv2_util.h +++ b/include/lv2/core/lv2_util.h @@ -65,7 +65,7 @@ lv2_features_data(const LV2_Feature* const* features, const char* const uri) static inline const char* lv2_features_query(const LV2_Feature* const* features, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, features); const char* uri = NULL; diff --git a/include/lv2/log/logger.h b/include/lv2/log/logger.h index 83cd653..37fe564 100644 --- a/include/lv2/log/logger.h +++ b/include/lv2/log/logger.h @@ -90,7 +90,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_error(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Error, fmt, args); va_end(args); @@ -102,7 +102,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_note(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Note, fmt, args); va_end(args); @@ -114,7 +114,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_trace(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Trace, fmt, args); va_end(args); @@ -126,7 +126,7 @@ LV2_LOG_FUNC(2, 3) static inline int lv2_log_warning(LV2_Log_Logger* logger, const char* fmt, ...) { - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, fmt); const int ret = lv2_log_vprintf(logger, logger->Warning, fmt, args); va_end(args); diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build index 834695c..72c68be 100644 --- a/meson/suppressions/meson.build +++ b/meson/suppressions/meson.build @@ -33,6 +33,13 @@ if is_variable('cc') '-Wno-switch-enum', '-Wno-unused-parameter', ] + + if host_machine.system() == 'windows' + c_suppressions += [ + '-Wno-format-nonliteral', + ] + endif + elif cc.get_id() == 'gcc' c_suppressions += [ '-Wno-bad-function-cast', @@ -91,7 +98,7 @@ if is_variable('cpp') if get_option('strict') if cpp.get_id() in ['clang', 'emscripten'] - cpp_suppressions = [ + cpp_suppressions += [ '-Wno-cast-align', '-Wno-cast-qual', '-Wno-documentation-unknown-command', @@ -100,8 +107,14 @@ if is_variable('cpp') '-Wno-reserved-id-macro', ] + if host_machine.system() == 'windows' + cpp_suppressions += [ + '-Wno-format-nonliteral', + ] + endif + elif cpp.get_id() == 'gcc' - cpp_suppressions = [ + cpp_suppressions += [ '-Wno-cast-align', '-Wno-cast-qual', '-Wno-inline', @@ -117,7 +130,7 @@ if is_variable('cpp') endif elif cpp.get_id() == 'msvc' - cpp_suppressions = [ + cpp_suppressions += [ '/wd4514', # unreferenced inline function has been removed '/wd4706', # assignment within conditional expression '/wd4710', # function not inlined diff --git a/plugins/.clang-tidy b/plugins/.clang-tidy index d7c1fb9..96d7f9f 100644 --- a/plugins/.clang-tidy +++ b/plugins/.clang-tidy @@ -9,6 +9,5 @@ Checks: > -hicpp-signed-bitwise, -llvm-header-guard, -misc-unused-parameters, - -modernize-macro-to-enum, -readability-function-cognitive-complexity, InheritParentConfig: true diff --git a/plugins/eg-params.lv2/state_map.h b/plugins/eg-params.lv2/state_map.h index a223243..2a29e09 100644 --- a/plugins/eg-params.lv2/state_map.h +++ b/plugins/eg-params.lv2/state_map.h @@ -68,7 +68,7 @@ state_map_init( { // Set dict entries from parameters unsigned i = 0; - va_list args; + va_list args; // NOLINT(cppcoreguidelines-init-variables) va_start(args, handle); for (const char* uri = NULL; (uri = va_arg(args, const char*)); ++i) { const char* type = va_arg(args, const char*); diff --git a/test/headers/.clang-tidy b/test/headers/.clang-tidy index f98ca17..dd0b95f 100644 --- a/test/headers/.clang-tidy +++ b/test/headers/.clang-tidy @@ -5,9 +5,11 @@ Checks: > *, -*-magic-numbers, -altera-*, + -bugprone-assignment-in-if-condition, -bugprone-easily-swappable-parameters, -bugprone-macro-parentheses, -llvmlibc-restrict-system-libc-headers, + -modernize-macro-to-enum, -performance-no-int-to-ptr, -readability-identifier-length, CheckOptions: diff --git a/test/headers/meson.build b/test/headers/meson.build index e0a2d76..cee8965 100644 --- a/test/headers/meson.build +++ b/test/headers/meson.build @@ -12,6 +12,12 @@ if get_option('strict') '-Wno-padded', ] + if host_machine.system() == 'windows' + header_c_suppressions += [ + '-Wno-format-nonliteral', + ] + endif + elif cc.get_id() == 'gcc' header_c_suppressions += [ '-Wno-cast-align', |