title: Shouldn't clang suppress warnings from a header file in /usr/local/include?
body: <p>I'm building an application on OSX that uses Boost.Log. When I set the warning flags to include <code>-Wextra</code> I get warnings about an unused parameter in one of the Boost header files.</p>
  
  <p>MWE:</p>
  
  <pre><code>#include &lt;boost/log/trivial.hpp&gt;
  
  int main() {
    BOOST_LOG_TRIVIAL(error) &lt;&lt; "no log";
    return 0;
  }
  </code></pre>
  
  <p>Save as <code>nolog.cpp</code>, then compile with:</p>
  
  <pre><code>c++ -Wextra -DBOOST_LOG_DYN_LINK -o nolog -lboost_log-mt nolog.cpp
  </code></pre>
  
  <p>I'm seeing the following error:</p>
  
  <pre><code>In file included from nolog.cpp:1:
  In file included from /usr/local/include/boost/log/trivial.hpp:23:
  In file included from /usr/local/include/boost/log/sources/record_ostream.hpp:36:
  In file included from /usr/local/include/boost/log/utility/formatting_ostream.hpp:30:
  /usr/local/include/boost/log/detail/attachable_sstream_buf.hpp:284:67: warning: unused parameter 'n' [-Wunused-parameter]
      size_type length_until_boundary(const char_type* s, size_type n, size_type max_size, mpl::true_) const
                                                                    ^
  1 warning generated.
  </code></pre>
  
  <p>I would have expected that anything in <code>/usr/local/include</code> would be treated as a system header, and hence have its warnings suppressed, but apparently not.</p>
  
  <p>I have also tried adding <code>--system-header-prefix /usr/local/include</code> but that didn't make a difference.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Following @KompjoeFriek's suggestion, here is the output with <code>-###</code>:</p>
  
  <pre><code>$ c++ -Wextra -DBOOST_LOG_DYN_LINK -o nolog -lboost_log-mt --system-header-prefix /usr/local/include -### nolog.cpp
  Apple LLVM version 9.0.0 (clang-900.0.39.2)
  Target: x86_64-apple-darwin17.3.0
  Thread model: posix
  InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
   "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" "-cc1" "-triple" "x86_64-apple-macosx10.13.0" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-mrelax-all" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "nolog.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-mdisable-fp-elim" "-fno-strict-return" "-masm-verbose" "-munwind-tables" "-target-cpu" "penryn" "-target-linker-version" "305" "-dwarf-column-info" "-debugger-tuning=lldb" "-resource-dir" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0" "--system-header-prefix=/usr/local/include" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" "-D" "BOOST_LOG_DYN_LINK" "-I/usr/local/include" "-stdlib=libc++" "-Wextra" "-fdeprecated-macro" "-fdebug-compilation-dir" "/Users/dlindelof/Work/endor/libneurobat" "-ferror-limit" "19" "-fmessage-length" "181" "-stack-protector" "1" "-fblocks" "-fobjc-runtime=macosx-10.13.0" "-fencode-extended-block-signature" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "/var/folders/gf/l78h_kjs1bg6j_p18gt05_t80000gn/T/nolog-1cdc02.o" "-x" "c++" "nolog.cpp"
   "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-demangle" "-lto_library" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib" "-no_deduplicate" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.13.0" "-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" "-o" "nolog" "-lboost_log-mt" "/var/folders/gf/l78h_kjs1bg6j_p18gt05_t80000gn/T/nolog-1cdc02.o" "-L/usr/local/lib" "-lc++" "-lSystem" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a"
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After running <code>xcode-select install</code>, the problem disappeared. No. Idea. Why.</p>