From 949fc7bdd7e0bdf3e5f4a6252511c1c11b9b13bc Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Wed, 1 Feb 2017 22:06:24 -0800 Subject: [PATCH] fix IWYU lint Commit 8645aa94 was made because it seemed necessary at the time. However, when I run `make lint-all` now it complains about include loops for header `signal.h`. This reverts part of that earlier commit to get sane behavior from IWYU again. --- build_tools/lint.fish | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build_tools/lint.fish b/build_tools/lint.fish index ae6e5c1f6..4a892aacb 100755 --- a/build_tools/lint.fish +++ b/build_tools/lint.fish @@ -35,13 +35,15 @@ for arg in $argv set cppcheck_args $cppcheck_args $arg else if string match -q -- '-I*' $arg set cppcheck_args $cppcheck_args $arg + else if string match -q -- '-iquote*' $arg + set cppcheck_args $cppcheck_args $arg end end # Not sure when this became necessary but without these flags cppcheck no longer works on macOS. -# It complains that "Cppcheck cannot find all the include files." It appears that cppcheck used -# to, but no longer, recognizes the -iquote flag. So switch to hardcoding the appropriate -I flags. -set cppcheck_args $cppcheck_args -I . -I ./src +# It complains that "Cppcheck cannot find all the include files." Adding these include paths should +# be harmless everywhere else. +set cppcheck_args $cppcheck_args -I /usr/include -I . if test "$machine_type" = "x86_64" set cppcheck_args -D__x86_64__ -D__LP64__ $cppcheck_args @@ -114,7 +116,7 @@ if set -q c_files[1] echo echo ======================================== - echo 'Running `cppcheck --check-config` to identify missing includes similar problems.' + echo 'Running `cppcheck --check-config` to identify missing includes and similar problems.' echo 'Ignore unmatchedSuppression warnings as they are probably false positives we' echo 'cannot suppress.' echo ========================================