When compiling sources on MSVC with NVALGRIND being defined, it shows this error: 1>include\Valgrind/valgrind.h(4493) : error C2220: warning treated as error - no 'object' file generated 1>include\Valgrind/valgrind.h(4493) : warning C4100: 'format' : unreferenced formal parameter 1>include\Valgrind/valgrind.h(4531) : warning C4100: 'format' : unreferenced formal parameter Reproducible: Always
Created attachment 96139 [details] valgrind-h-fix-MSVC-warning-v1 This patch fixes the issue. But it looks a bit complicated. It defines two different versions for VALGRIND_PRINTF depending on if compiler is gcc (understands __attribute__(unused) or not). Maybe it would be simpler to just have this version for all compilers in case of NVALGRIND: static int #if defined(_MSC_VER) __inline #endif VALGRIND_PRINTF(...) { return 0; }
Fixed in r15762.