[PATCH] D52524: Add -Wpoison-system-directories warning

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 12:14:50 PDT 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

Aside from a minor nit, this LGTM. However, I'm not the most familiar with how cross-compiling works in the first place, so I may be the wrong one to approve this.



================
Comment at: clang/lib/Frontend/InitHeaderSearch.cpp:141-143
+  if (HasSysroot) {
+    if (MappedPathStr.startswith("/usr/include") ||
+        MappedPathStr.startswith("/usr/local/include")) {
----------------
These should be combined into a single if statement:
```
if (HasSysroot && (MappedPathStr.startswith(...) || MappedPathStr.startswith(...))) {
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D52524/new/

https://reviews.llvm.org/D52524





More information about the cfe-commits mailing list