• Home
  • Raw
  • Download

Lines Matching +full:non +full:- +full:array

1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd.
6 # http://www.apache.org/licenses/LICENSE-2.0
14 option(PANDA_ENABLE_CLANG_TIDY "Enable clang-tidy checks during compilation" true)
16 # There seems to be a bug in either clang-tidy or CMake:
17 # When clang/gcc is used for cross-compilation, it is ran on host and use defines and options for h…
18 # For example for arm32 cross-compilation Clang-Tidy:
19 # - don't know about -march=armv7-a
20 # - believes that size of pointer is 64 instead of 32 for aarch32
36 # Currently we fix a certain version of clang-tidy to avoid unstable linting,
38 set(panda_clang_tidy "clang-tidy-9")
40 # Require clang-tidy
44 DOC "Path to clang-tidy executable")
46 …message(FATAL_ERROR "clang-tidy not found, but requested for build. Use -DPANDA_ENABLE_CLANG_TIDY=…
51 message(STATUS "clang-tidy found: ${CLANG_TIDY}")
52 # NB! Even if config is malformed, clang-tidy -dump-config returns 0 on failure.
55 COMMAND ${CLANG_TIDY} -dump-config
62 # Create a preprocessor definition that depends on .clang-tidy content so
63 # the compile command will change when .clang-tidy changes. This ensures
64 # that a subsequent build re-runs clang-tidy on all sources even if they
66 # definition. We add it to targets on which we run clang-tidy just to
67 # get the build dependency on the .clang-tidy file.
68 file(SHA1 ${CMAKE_CURRENT_SOURCE_DIR}/.clang-tidy clang_tidy_sha1)
71 configure_file(${PANDA_ROOT}/.clang-tidy ${PANDA_BINARY_ROOT}/.clang-tidy COPYONLY)
74 # Add a target to clang-tidy checks.
80 # "-check-to-be-disabled"
81 # "-glob-to-be-disabled-*"
82 # "check-to-be-enabled"
83 # "glob-to-be-enabled-*"
86 # This function makes target_name to be co-compiled with clang-tidy.
87 # The list of CHECKS allows to pass per-target checks in additions to
88 # global ones (see below). CHECKS follow clang-tidy syntax of checks.
95 # * We maintain the list of global exceptions in this function (not in .clang-tidy)
98 # * -header-filter is set to check only headers of the target_name. It is supposed
118 "-config="
119 "-format-style=file"
120 #"-header-filter='^(${CMAKE_CURRENT_SOURCE_DIR}|${CMAKE_CURRENT_BINARY_DIR}).*'"
121 "-p='${PANDA_BINARY_ROOT}'"
125 …# aliases for other checks(here full list: https://clang.llvm.org/extra/clang-tidy/checks/list.htm…
126 "-hicpp-braces-around-statements" # alias for readability-braces-around-statements
127 … "-google-readability-braces-around-statements" # alias for readability-braces-around-statements
128 "-google-readability-function-size" # alias for readability-function-size
129 "-hicpp-explicit-conversions" # alias for google-explicit-constructor
130 "-hicpp-function-size" # alias for readability-function-size
131 "-hicpp-no-array-decay" # alias for cppcoreguidelines-pro-bounds-array-to-pointer-decay
132 "-hicpp-avoid-c-arrays" # alias for modernize-avoid-c-arrays
133 "-cppcoreguidelines-avoid-c-arrays" # alias for modernize-avoid-c-arrays
134 "-cppcoreguidelines-avoid-magic-numbers" # alias for readability-magic-numbers
135 …"-cppcoreguidelines-non-private-member-variables-in-classes" # alias for misc-non-private-member-v…
136 "-cert-dcl03-c" # alias for misc-static-assert
137 "-hicpp-static-assert" # alias for misc-static-assert
138 "-hicpp-no-malloc" # alias for cppcoreguidelines-no-malloc
139 "-hicpp-vararg" # alias for cppcoreguidelines-pro-type-vararg
140 "-hicpp-member-init" # alias for cppcoreguidelines-pro-type-member-init
141 "-hicpp-move-const-arg" # alias for performance-move-const-arg
142 "-cert-oop54-cpp" # alias for bugprone-unhandled-self-assignment
144 … "-bugprone-macro-parentheses" # disabled because it is hard to write macros with types with it
145 "-llvm-header-guard" # disabled because of incorrect root prefix
146 "-llvm-include-order" # disabled because conflicts with the clang-format
147 "-readability-identifier-naming" # disabled because we will use little-hump-style
148 "-google-runtime-references" # disabled to use non-const references
149 …"-fuchsia-trailing-return" # disabled because we have a lot of false positives and it is stylisti…
150 …"-fuchsia-default-arguments-calls" # disabled because we use functions with default arguments a lot
151 …"-fuchsia-default-arguments-declarations" # disabled because we use functions with default argumen…
152 "-modernize-use-trailing-return-type" # disabled as a stylistic check
153 …"-clang-analyzer-optin.cplusplus.UninitializedObject" # disabled due to instability on clang-9 and…
154 "-readability-static-accessed-through-instance" # TODO(knazarov) fix all occurences
155 "-readability-convert-member-functions-to-static" # TODO(knazarov) fix all occurences
156 "-bugprone-sizeof-expression" # TODO(knazarov) fix all occurences
157 "-bugprone-branch-clone" # TODO(knazarov) fix all occurences
159 … "-cppcoreguidelines-owning-memory" # TODO(dtrubenkov): look if we want to use GSL or gsl-lite
160 …"-cppcoreguidelines-pro-bounds-array-to-pointer-decay" # TODO(dtrubenkov): look into issue with A…
161 …"-cppcoreguidelines-pro-bounds-constant-array-index" # TODO(dtrubenkov): look if we want to use G…
162 … "-cppcoreguidelines-pro-type-const-cast" # TODO(dtrubenkov): consider to remove from global list
163 …"-cppcoreguidelines-pro-type-reinterpret-cast" # TODO(dtrubenkov): consider to remove from global…
164 "-cppcoreguidelines-pro-type-static-cast-downcast" # TODO(dtrubenkov): look into it
165 "-fuchsia-default-arguments" # TODO(dtrubenkov): look into it
166 "-fuchsia-overloaded-operator" # TODO(dtrubenkov): consider to remove from global list
167 "-modernize-use-nodiscard" # TODO(dtrubenkov): look into it
168 "-cert-dcl50-cpp" # ailas for cppcoreguidelines-pro-type-vararg
170 "-hicpp-noexcept-move" # For some reason become failed in DEFAULT_MOVE_SEMANTIC
171 "-performance-noexcept-move-constructor" # Same as above
176 set(clang_tidy_checks "-checks=*,${default_exceptions}")