I'm having an interesting problem. I'm compiling a toy compiler with
clang++ -g -x c++ y.tab.c lex.yy.c semantic_actions.cpp -o parser -lfl
Run Code Online (Sandbox Code Playgroud)
In y.tab.c I included semantic_actios.hpp and the contents in semantic_actions.hpp are some method declarations that are used in y.tab.c. That compiles fine.
However if I change it to
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
Run Code Online (Sandbox Code Playgroud)
I see
semantic_actions.o:1:1: error: source file is not valid UTF-8
<CF><FA><ED><FE><U+0007>
^ …Run Code Online (Sandbox Code Playgroud)