|
From: Florian K. <fl...@ei...> - 2016-01-14 09:19:37
|
On 13.01.2016 10:50, Matthias Schwarzott wrote:
> Am 13.01.2016 um 08:18 schrieb Florian Krohm:
>> Given that we already have some support for MSC_VER in valgrind.h it
>> would be good to sort this out. But that file is already quite messy
>> with all the ifdeffery that is going on in there so we should be careful
>> adding more..
>>
> The attached patch is a draft version of a different way to cleanup
> VALGRIND_PRINTF.
>
Thanks for the patch.
Simplifying that file is a good thing. But I'd like to understand
whether we can get rid of some of the special casing.
__inline:
I presume this is needed to keep MSC_VER from complaining that the
function is possibly unused. Right?
uintptr_t:
I do not unerstand why this type is needed and we cannot use unsigned
long instead. svn archeology did not reveal anything except that Bart
might know.
Your #define __VALGRIND_PRINTF_ARGLIST ... will cause warnings with
most compilers because C does not allow such parameter lists.
To suppress the warning about the unused parameter we could use:
Index: include/valgrind.h
===================================================================
--- include/valgrind.h (revision 15754)
+++ include/valgrind.h (working copy)
@@ -6759,6 +6759,7 @@
VALGRIND_PRINTF(const char *format, ...)
{
#if defined(NVALGRIND)
+ if (format) *(volatile const *)format; // avoid compiler warning
return 0;
#else /* NVALGRIND */
#if defined(_MSC_VER) || defined(__MINGW64__)
@@ -6797,6 +6798,7 @@
VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
{
#if defined(NVALGRIND)
+ if (format) *(volatile const *)format; // avoid compiler warning
return 0;
#else /* NVALGRIND */
#if defined(_MSC_VER) || defined(__MINGW64__)
Florian
|