From eaa6880a5b0e7ee5649572afe4794fbcd209802b Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Thu, 22 Feb 2018 11:33:25 +0100 Subject: [PATCH] Hack because of internal buffer overflow when writing binary data files in icc + stdc++ --- src/sdf/odata_file.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sdf/odata_file.cc b/src/sdf/odata_file.cc index 02bb84ab..f81f52bf 100644 --- a/src/sdf/odata_file.cc +++ b/src/sdf/odata_file.cc @@ -31,6 +31,9 @@ void write_raw_with_endian(std::ofstream &s, const number *data, size_t n) std::cerr << "I/O error when writing to SDF stream"; abort(); } + // Horrible hack to ensure icc flushes our buffers and does not + // cause buffer overflow. + s.flush(); } #else