Summary: | valgrind.h: Some code remains even when defining NVALGRIND | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Matthias Schwarzott <zzam> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 3.12 SVN | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
valgrind-improve-unused-parameter-on-r15763.patch
valgrind-3.12.0-valgrind_printf-simple-nvalgrind-fix-plus-testcase.patch |
Description
Matthias Schwarzott
2016-01-28 19:36:00 UTC
Created attachment 96891 [details]
valgrind-improve-unused-parameter-on-r15763.patch
This patch implements the __attribute__ usage.
But I am not sure about the ifdef code. It is just what was originally around the __attribute__ usage.
The simplest solution could be to use "(void)format" and protect this with an ifdef checking that we are not running under the problematic static code checker. e.g. QT has a macro like this: #define Q_UNUSED(x) (void)x; To be used inside functions: Q_UNUSED(format) Created attachment 104809 [details]
valgrind-3.12.0-valgrind_printf-simple-nvalgrind-fix-plus-testcase.patch
This new patch fixes the problem in the simplest way: "(void)format;"
Additionally it adds a testcase to compile and run the existing vgprintf.c with NVALGRIND
Patch valgrind-3.12.0-valgrind_printf-simple-nvalgrind-fix-plus-testcase.patch has been tested with MSVC 2008 configured to warning level 4. Committed, r16290. Thanks for the patch. |