Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit a6ec96e

Browse files
authored
Patch to fix cppcheck with newer glibc (#3471)
1 parent f0b6e1b commit a6ec96e

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

WORKSPACE

+5-3
Original file line numberDiff line numberDiff line change
@@ -930,10 +930,12 @@ http_archive(
930930

931931
http_archive(
932932
name = "com_github_danmar_cppcheck",
933-
urls = ["https://github.com/danmar/cppcheck/archive/1.87.zip"],
934-
strip_prefix = "cppcheck-1.87",
935933
build_file = "@//:third_party/cppcheck/cppcheck.BUILD",
936-
sha256 = "b3de7fbdc1a23d7341b55f7f88877e106a76847bd5a07fa721c07310b625318b",
934+
patch_args = ["-p2"],
935+
patches = ["//third_party/cppcheck:cppcheck-readdir-fix.patch"],
936+
sha256 = "cb0e66cbe2d6b655fce430cfaaa74b83ad11c91f221e3926f1ca3211bb7c906b",
937+
strip_prefix = "cppcheck-1.90",
938+
urls = ["https://github.com/danmar/cppcheck/archive/1.90.zip"],
937939
)
938940

939941
http_archive(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -Naur cppcheck/cppcheck-1.90/cli/filelister.cpp cppcheck-fixed/cppcheck-1.90/cli/filelister.cpp
2+
--- cppcheck/cppcheck-1.90/cli/filelister.cpp 2020-02-20 22:42:28.000000000 -0500
3+
+++ cppcheck-fixed/cppcheck-1.90/cli/filelister.cpp 2020-02-20 22:44:48.000000000 -0500
4+
@@ -194,7 +194,7 @@
5+
std::string new_path;
6+
new_path.reserve(path.length() + 100);// prealloc some memory to avoid constant new/deletes in loop
7+
8+
- while ((readdir_r(dir, &entry, &dir_result) == 0) && (dir_result != nullptr)) {
9+
+ while ((dir_result = readdir(dir)) != NULL) {
10+
11+
if ((std::strcmp(dir_result->d_name, ".") == 0) ||
12+
(std::strcmp(dir_result->d_name, "..") == 0))

0 commit comments

Comments
 (0)