title: clang++ link failure: error: source file is not valid UTF-8?
body: <p>I'm having an interesting problem. I'm compiling a toy compiler with</p>
  
  <pre><code>clang++ -g -x c++ y.tab.c lex.yy.c semantic_actions.cpp -o parser -lfl
  </code></pre>
  
  <p>In <code>y.tab.c</code> I included <code>semantic_actios.hpp</code> and the contents in <code>semantic_actions.hpp</code> are some method declarations that are used in <code>y.tab.c</code>. That compiles fine.</p>
  
  <p>However if I change it to </p>
  
  <pre><code>clang++ -c -g -x c++ semantic_actions.cpp -o semantic_actions.o
  clang++ -g -x c++ y.tab.c lex.yy.c -o parser semantic_actions.o -lfl
  </code></pre>
  
  <p>I see</p>
  
  <pre><code>semantic_actions.o:1:1: error: source file is not valid UTF-8
  &lt;CF&gt;&lt;FA&gt;&lt;ED&gt;&lt;FE&gt;&lt;U+0007&gt;
  ^
  semantic_actions.o:1:2: error: source file is not valid UTF-8
  &lt;CF&gt;&lt;FA&gt;&lt;ED&gt;&lt;FE&gt;&lt;U+0007&gt;
      ^
  semantic_actions.o:1:3: error: source file is not valid UTF-8
  &lt;CF&gt;&lt;FA&gt;&lt;ED&gt;&lt;FE&gt;&lt;U+0007&gt;
           ^
  semantic_actions.o:1:4: error: source file is not valid UTF-8
  &lt;CF&gt;&lt;FA&gt;&lt;ED&gt;&lt;FE&gt;&lt;U+0007&gt;
              ^
  semantic_actions.o:1:5: error: expected unqualified-id
  &lt;CF&gt;&lt;FA&gt;&lt;ED&gt;&lt;FE&gt;&lt;U+0007&gt;
                  ^
  semantic_actions.o:1:6: warning: null character ignored [-Wnull-    character]
  &lt;CF&gt;&lt;FA&gt;&lt;ED&gt;&lt;FE&gt;&lt;U+0007&gt;
  // and the output goes on and on
  </code></pre>
  
  <p>I must missed something very basic here. I'm on Mac OS Yosemite </p>
  
  <pre><code>$ clang++ --version
  Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
  Target: x86_64-apple-darwin14.1.0
  Thread model: posix
  </code></pre>
  
  <p>Can someone have a look at it? Thanks!</p>