From ba64ec6e91934982366cff77d8f9d2f7afe28d88 Mon Sep 17 00:00:00 2001 From: David Adam Date: Mon, 25 Feb 2019 22:46:31 +0800 Subject: [PATCH] lint: drop CXX argument The "fatal error: 'stddef.h' file not found" error is caused by incomplete installation of IWYU, which can be fixed directly. See https://github.com/include-what-you-use/include-what-you-use/issues/100 --- Makefile.in | 4 ++-- build_tools/lint.fish | 14 +------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index 8ac911862..7f457bd15 100644 --- a/Makefile.in +++ b/Makefile.in @@ -653,9 +653,9 @@ depend: | show-MKDIR_P # TODO - why not have the Makefile run lint.fish on actual files itself (generate a report target?) # lint: - $v build_tools/lint.fish "$(CXX)" $(CXXFLAGS) $(CPPFLAGS) + $v build_tools/lint.fish -- $(CXXFLAGS) $(CPPFLAGS) lint-all: - $v build_tools/lint.fish --all "$(CXX)" $(CXXFLAGS) $(CPPFLAGS) + $v build_tools/lint.fish --all -- $(CXXFLAGS) $(CPPFLAGS) .PHONY: lint lint-all # diff --git a/build_tools/lint.fish b/build_tools/lint.fish index 616bea1ea..cce1b488a 100755 --- a/build_tools/lint.fish +++ b/build_tools/lint.fish @@ -13,19 +13,7 @@ set all no set kernel_name (uname -s) set machine_type (uname -m) -argparse -s a/all -- $argv -set -q argv[1]; and set -gx CXX $argv[1] -set -e argv[1] - -if test $kernel_name = Linux - # This is an awful hack. However, the include-what-you-use program spews lots of errors like - # /usr/include/unistd.h:226:10: fatal error: 'stddef.h' file not found - # if we don't explicitly tell it where to find the system headers on Linux. See - # http://stackoverflow.com/questions/19642590/libtooling-cant-find-stddef-h-nor-other-headers/ - set -l sys_includes ($CXX -v -c src/builtin.cpp 2>&1 | \ - sed -n -e '/^#include <...> search/,/^End of search list/s/^ *//p')[2..-2] - set -x CPLUS_INCLUDE_PATH (string join ':' $sys_includes) -end +argparse a/all -- $argv # We only want -D and -I options to be passed thru to cppcheck. for arg in $argv