aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/expand.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-04-20 23:00:54 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-04-26 15:02:22 -0700
commit1f06e5f0b9ee483053b987c9cab9f1f5fce2590c (patch)
tree8ebebff055f4aa184e7d7b021190ab01d9376992 /src/expand.cpp
parentdaa217f533490e0b9bc4113a143e8f38de922b7a (diff)
add better support for IWYU and fix things
Remove the "make iwyu" build target. Move the functionality into the recently introduced lint.fish script. Fix a lot, but not all, of the include-what-you-use errors. Specifically, it fixes all of the IWYU errors on my OS X server but only removes some of them on my Ubuntu 14.04 server. Fixes #2957
Diffstat (limited to 'src/expand.cpp')
-rw-r--r--src/expand.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/expand.cpp b/src/expand.cpp
index 72a72e77..1ac626e9 100644
--- a/src/expand.cpp
+++ b/src/expand.cpp
@@ -4,11 +4,10 @@ String expansion functions. These functions perform several kinds of
parameter expansion.
*/
-
-#include "config.h" // IWYU pragma: keep
+// IWYU pragma: no_include <cstddef>
+#include "config.h"
#include <stdlib.h>
-#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
#include <wchar.h>
@@ -16,38 +15,43 @@ parameter expansion.
#include <wctype.h>
#include <errno.h>
#include <pwd.h>
-#include <dirent.h>
-#include <sys/stat.h>
#include <unistd.h>
#include <algorithm>
#ifdef HAVE_SYS_SYSCTL_H
-#include <sys/sysctl.h> // IWYU pragma: keep - needed for KERN_PROCARGS2
+#include <sys/sysctl.h> // IWYU pragma: keep
#endif
-
#include <assert.h>
#include <vector>
-
#ifdef SunOS
#include <procfs.h>
#endif
+#include <memory> // IWYU pragma: keep
+#include <stdio.h>
+#if __APPLE__
+#include <sys/proc.h>
+#else
+#include <sys/stat.h>
+#include <dirent.h>
+#endif
#include "fallback.h" // IWYU pragma: keep
#include "util.h"
-
#include "common.h"
-#include "wutil.h"
+#include "wutil.h" // IWYU pragma: keep
#include "env.h"
#include "proc.h"
-#include "parser.h"
#include "path.h"
#include "expand.h"
#include "wildcard.h"
#include "exec.h"
-#include "tokenizer.h"
#include "complete.h"
#include "iothread.h"
-
#include "parse_util.h"
+#include "parse_constants.h"
+#ifdef KERN_PROCARGS2
+#else
+#include "tokenizer.h"
+#endif
/**
Description for child process