Skip to content

Commit

Permalink
[Fix #74] nhc: Don't ignore Clang's return value.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin1 committed Nov 24, 2015
1 parent 407c823 commit 2039510
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nhc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ let do_compile src_path bin_path keep_ast keep_il =
let il_path = bin_path ^ ".cpp" in
Out_channel.write_all il_path ~data:cpp
else ();
let cpp_compile = "clang++ -Wall -pedantic -fsanitize=address -std=c++14 -O2 -xc++ - support.cpp" in
let ch = Unix.open_process_out cpp_compile in
let cxx = "clang++ -Wall -pedantic -fsanitize=address -std=c++14 -O2 -xc++ - support.cpp" in
let ch = Unix.open_process_out cxx in
Out_channel.output_string ch cpp;
ignore(Unix.close_process_out ch)
if Unix.close_process_out ch <> Result.Ok( () ) then
failwith "Internal error: C++ compilation failed"
else ();
()

let command =
Command.basic
Expand Down

0 comments on commit 2039510

Please sign in to comment.