diff --git a/core/src/main/cpp/.clang-tidy b/core/src/main/cpp/.clang-tidy new file mode 100644 index 00000000..e77038ac --- /dev/null +++ b/core/src/main/cpp/.clang-tidy @@ -0,0 +1,64 @@ +--- +Checks: > + -*, + bugprone-*, + google-*, + misc-*, + modernize-*, + performance-*, + portability-*, + readability-*, + clang-analyzer-*, + llvm-include-order, + -modernize-use-trailing-return-type, + +# Turn all the warnings from the checks above into errors. +WarningsAsErrors: "*" + +CheckOptions: + - key: readability-identifier-naming.ClassCase + value: CamelCase + - key: readability-identifier-naming.ClassMemberCase + value: lower_case + - key: readability-identifier-naming.EnumCase + value: CamelCase + - key: readability-identifier-naming.EnumConstantCase + value: CamelCase + - key: readability-identifier-naming.EnumConstantPrefix + value: k + - key: readability-identifier-naming.FunctionCase + value: CamelCase + - key: readability-identifier-naming.GlobalConstantCase + value: CamelCase + - key: readability-identifier-naming.GlobalConstantPrefix + value: k + - key: readability-identifier-naming.StaticConstantCase + value: CamelCase + - key: readability-identifier-naming.StaticConstantPrefix + value: k + - key: readability-identifier-naming.StaticVariableCase + value: CamelCase + - key: readability-identifier-naming.StaticVariablePrefix + value: k + - key: readability-identifier-naming.MacroDefinitionCase + value: UPPER_CASE + - key: readability-identifier-naming.MemberCase + value: lower_case + - key: readability-identifier-naming.MemberSuffix + value: _ + - key: readability-identifier-naming.NamespaceCase + value: lower_case + - key: readability-identifier-naming.ParameterCase + value: lower_case + - key: readability-identifier-naming.TypeAliasCase + value: CamelCase + - key: readability-identifier-naming.TypedefCase + value: CamelCase + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.IgnoreMainLikeFunctions + value: 1 + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: 1 + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: 1 diff --git a/core/src/main/cpp/external/DexBuilder b/core/src/main/cpp/external/DexBuilder index 9141e5ae..236b1b03 160000 --- a/core/src/main/cpp/external/DexBuilder +++ b/core/src/main/cpp/external/DexBuilder @@ -1 +1 @@ -Subproject commit 9141e5aed87360fa6926ad05a8ac1511fc6bcbe6 +Subproject commit 236b1b03b4c6f9465faba94a0bae7ed8c99c6e67 diff --git a/core/src/main/cpp/main/include/art/runtime/gc/scoped_gc_critical_section.h b/core/src/main/cpp/main/include/art/runtime/gc/scoped_gc_critical_section.h index f761b95e..2dd72963 100644 --- a/core/src/main/cpp/main/include/art/runtime/gc/scoped_gc_critical_section.h +++ b/core/src/main/cpp/main/include/art/runtime/gc/scoped_gc_critical_section.h @@ -28,8 +28,8 @@ namespace art { class GCCriticalSection { private: - void* self_; - const char* section_name_; + [[maybe_unused]] void* self_; + [[maybe_unused]] const char* section_name_; }; class ScopedGCCriticalSection { @@ -56,8 +56,8 @@ namespace art { RETRIEVE_MEM_FUNC_SYMBOL(destructor, "_ZN3art2gc23ScopedGCCriticalSectionD2Ev"); } private: - GCCriticalSection critical_section_; - const char* old_no_suspend_reason_; + [[maybe_unused]] GCCriticalSection critical_section_; + [[maybe_unused]] const char* old_no_suspend_reason_; }; } } diff --git a/core/src/main/cpp/main/include/art/runtime/hidden_api.h b/core/src/main/cpp/main/include/art/runtime/hidden_api.h index c1dbe671..da79fd82 100644 --- a/core/src/main/cpp/main/include/art/runtime/hidden_api.h +++ b/core/src/main/cpp/main/include/art/runtime/hidden_api.h @@ -115,7 +115,7 @@ namespace art { } ); - static void DisableHiddenApi(const SandHook::ElfImg &handle) { + static void DisableHiddenApi([[maybe_unused]] const SandHook::ElfImg &handle) { const int api_level = lspd::GetAndroidApiLevel(); if (api_level < __ANDROID_API_P__) {