title: scan-build using scons uses gcc instead of clang
body: <p>I'm trying to make <code>scan-build</code> use clang instead of gcc for compiling, but for some reason <code>scons</code> always uses gcc.</p>
  
  <p>If I execute <code>scons</code>, I get this:</p>
  
  <blockquote>
  <pre><code>scons: Reading SConscript files ...
  scons: done reading SConscript files.
  scons: Building targets ...
  /usr/bin/clang++ -o src/game.o -c -std=c++1z -pedantic -Wall -Wextra -Werror -O3 src/game.cpp
  src/game.cpp:13:62: error: unknown type name 'a'
  constexpr std::array&lt;piece_t, game::pieces_num&gt; game::pieces;a
                                                               ^
  src/game.cpp:15:7: error: constructor cannot have a return type
  game::game() noexcept {
        ^~~~
  src/game.cpp:16:5: error: use of undeclared identifier 'regen_pieces'
      regen_pieces();
      ^
  3 errors generated.
  scons: *** [src/game.o] Error 1
  scons: building terminated because of errors.
  </code></pre>
  </blockquote>
  
  <p>As you can see, it correctly uses <code>clang++</code> instead of <code>g++</code>. I achieved this using the answer in <a href="https://stackoverflow.com/questions/9305356/how-can-i-make-clangs-scan-build-work-with-scons">this</a> question.</p>
  
  <p>But, if I execute <code>scan-build scons</code>, I get this:</p>
  
  <blockquote>
  <pre><code>scan-build: Using '/usr/bin/clang-4.0' for static analysis
  scons: Reading SConscript files ...
  scons: done reading SConscript files.
  scons: Building targets ...
  /usr/bin/../lib/clang/c++-analyzer -o src/game.o -c -std=c++1z -pedantic -Wall -Wextra -Werror -O3 src/game.cpp
  src/game.cpp:13:62: error: 'a' does not name a type
   constexpr std::array&lt;piece_t, game::pieces_num&gt; game::pieces;a
                                                                ^
  scons: *** [src/game.o] Error 1
  scons: building terminated because of errors.
  scan-build: Removing directory '/tmp/scan-build-2017-04-27-213151-27247-1' because it contains no reports.
  scan-build: No bugs found.
  </code></pre>
  </blockquote>
  
  <p>Because the error messages are different, <code>scan-build</code> used gcc instead of clang.</p>
  
  <p>Here is my output for my environment variables:</p>
  
  <pre><code>$ printenv | grep clang
  CC=/usr/bin/clang
  CXX=/usr/bin/clang++
  </code></pre>
  
  <p>And my <code>SConstruct</code> file:</p>
  
  <pre><code>import os
  env = Environment()
  env["CC"] = os.getenv("CC") or env["CC"]
  env["CXX"] = os.getenv("CXX") or env["CXX"]
  env["ENV"].update(x for x in os.environ.items() if x[0].startswith("CCC_"))
  env["ENV"]["TERM"] = os.environ["TERM"]
  env.Append(CXXFLAGS = "-std=c++1z -pedantic -Wall -Wextra -Werror -O3")
  env.Append(LIBS = ["pthread"])
  env.Program("game", ["src/game.cpp", "src/main.cpp"])
  </code></pre>
  
  <p>So, my question is how can I make <code>scan-build</code> use clang?</p>