Skip to content

Commit f550638

Browse files
committed
clang-tidy: array-to-pointer decay happens only in one place
disable it there
1 parent 11e1e5e commit f550638

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

.clang-tidy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ Checks:
1212
- '-bugprone-easily-swappable-parameters' # Can't do much about this in many places.
1313
- '-cppcoreguidelines-avoid-c-arrays' # Makes sense for some arrays, but especially for char arrays using std::array isn't a good solution.
1414
- '-cppcoreguidelines-avoid-magic-numbers' # Generally good advice, but there are too many places where this is useful, for instance in tests.
15-
- '-cppcoreguidelines-pro-bounds-array-to-pointer-decay' # Limited use and many false positives including for all asserts.
1615
- '-cppcoreguidelines-pro-bounds-constant-array-index' # Don't want to add dependency on gsl library.
1716
- '-cppcoreguidelines-pro-bounds-pointer-arithmetic' # Difficult to get by without it...
1817
- '-cppcoreguidelines-pro-type-static-cast-downcast' # This is needed and totally okay if we are sure about the types.
1918
- '-cppcoreguidelines-pro-type-vararg' # Sometimes calling vararg functions is necessary.
2019
- '-fuchsia-*' # Much too strict.
2120
- '-hicpp-avoid-c-arrays' # Makes sense for some arrays, but especially for char arrays using std::array isn't a good solution.
22-
- '-hicpp-no-array-decay' # Limited use and many false positives including for all asserts.
2321
- '-hicpp-vararg' # Sometimes calling vararg functions is necessary.
2422
- '-llvm-prefer-static-over-anonymous-namespace' # Matter of taste and we are not following this one.
2523
- '-llvmlibc-*' # Not applicable.

src/command_show.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ namespace {
154154

155155
int execute_pager(const std::string& pager, bool with_color) {
156156
int pipefd[2];
157-
if (::pipe(pipefd) < 0) {
157+
if (::pipe(pipefd) < 0) { // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)
158158
throw std::system_error{errno, std::system_category(), "Could not run pager: pipe() call failed"};
159159
}
160160

0 commit comments

Comments
 (0)