aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-10-18 18:54:26 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2016-10-18 18:54:26 +0200
commit927d2a17d656715ea260a57fa914ff65d1a427fe (patch)
tree2ca228cd7ffa75074ba6641704349a7c61c89bb3 /cparser
parent5975b2e5568b5b32e42153d281017660de155e27 (diff)
downloadcompcert-927d2a17d656715ea260a57fa914ff65d1a427fe.tar.gz
compcert-927d2a17d656715ea260a57fa914ff65d1a427fe.zip
Catch errors from Unix for isatty.
There is a bug in the fstat implementation in ocaml 4.03 under windows. In order to prevent this we guard the isatty function with an additional try with.
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Cerrors.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml
index c50e12d9..804d3127 100644
--- a/cparser/Cerrors.ml
+++ b/cparser/Cerrors.ml
@@ -21,7 +21,10 @@ open Commandline
let error_fatal = ref false
let color_diagnostics =
let term = try Sys.getenv "TERM" with Not_found -> "" in
- ref (Unix.isatty Unix.stderr && term <> "dumb" && term <>"")
+ let activate = try
+ (Unix.isatty Unix.stderr && term <> "dumb" && term <>"")
+ with _ -> false in
+ ref activate
let num_errors = ref 0
let num_warnings = ref 0