|
From: Matthias S. <zz...@ge...> - 2017-03-28 05:46:40
|
Hi! I appreciate that my request to get rid of the compiler warning about VALGRIND_PRINTF was followed. See https://bugs.kde.org/show_bug.cgi?id=356817. But I am not so happy about the result: Now in NVALGRIND case valgrind.h uses a volatile read in VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE to silence the unused argument warning. http://sourceware.org/git/?p=valgrind.git;a=blob;f=include/valgrind.h;h=dc7dca7b8b0f02978dc297718d362488ebf63da2;hb=HEAD#l6772 That means if one disables all instrumentation (maybe for performance reasons) an unneeded volatile memory access remains in the code (of the client application). I vote for finding a different solution to tell the compiler to not show a warning. See https://bugs.kde.org/show_bug.cgi?id=358697 Regards Matthias |
|
From: Patrick J. L. <lop...@gm...> - 2017-03-29 00:36:13
|
In C++, you can just comment out the variable name in the argument list. In C... Well, I did not know. So I searched and found: http://stackoverflow.com/q/3599160/ It looks like a simple: (void)format; ...should do the trick. And I suspect it will not emit any code. - Pat |
|
From: Patrick J. L. <lop...@gm...> - 2017-03-29 00:41:54
|
Sorry, should have read the bug report more carefully. I see you already suggested this. Of course this is the right fix. If some static analyzer complains, that is a problem with the static analyzer and therefore irrelevant (IMO). - Pat On Tue, Mar 28, 2017 at 5:36 PM, Patrick J. LoPresti <lop...@gm...> wrote: > In C++, you can just comment out the variable name in the argument list. > > In C... Well, I did not know. So I searched and found: > > http://stackoverflow.com/q/3599160/ > > It looks like a simple: > > (void)format; > > ...should do the trick. And I suspect it will not emit any code. > > - Pat |
|
From: Julian S. <js...@ac...> - 2017-03-29 15:59:51
|
On 29/03/17 02:41, Patrick J. LoPresti wrote: > Sorry, should have read the bug report more carefully. I see you > already suggested this. > > Of course this is the right fix. If some static analyzer complains, > that is a problem with the static analyzer and therefore irrelevant > (IMO). I agree. Matthias, if you are happy to test the simple "(void)format;" solution with MSVC, then I am happy to commit it. Can you do that? J |