File drd/tests/std_string.cpp fails to compile with Intel compiler (versions 15.0.3, 16.0.0) Reproducible: Always Steps to Reproduce: 1. Configure Valgrind to be built with Intel compiler 2. Build regression tests (make regtest) Actual Results: File drd/tests/std_string.cpp fails to compile Expected Results: Regression tests are built and run The reason is a known bug of Intel compiler. If gcc 5.2.0 headers are used, in certain cases integers are misinterpreted as iterators: https://software.intel.com/en-us/forums/intel-c-compiler/topic/565143 . The compiler bug has high priority, but it is difficult to fix. The workaround is to change argument type from integer to double for Intel compilation.
Created attachment 96238 [details] Proposed workaround
Comment on attachment 96238 [details] Proposed workaround >--- valgrind-3.11.0/drd/tests/std_string.cpp 2015-09-08 16:23:31.000000000 +0300 >+++ valgrind-3.11.0/drd/tests/std_string.cpp 2015-12-15 21:47:14.114795475 +0300 >@@ -35,7 +35,13 @@ > { > for (int i = 0; i < 100; i++) { > std::string id("000"); >+#ifdef __INTEL_COMPILER >+// Intel compiler (version 15.0.3 - 16.0.0) fails to compile the following line due to a compiler bug >+// A known workaround is to use double instead of int >+ id.append(1.0, 'a' + i); >+#else > id.append(1, 'a' + i); >+#endif > std::list<std::string> record; > record.push_back("some data"); > addRecord();
Please reopen this bug if this behavior is reproducible with the latest version of the Intel compiler.