Re: [exim-dev] [Valgrind-users] [Bug 1050] [PATCH] Portabili…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Tony Finch
Date:  
À: Bart Van Assche
CC: exim-dev, Chris Thompson, David Woodhouse, valgrind-users, Steen Hammerum
Nouveaux-sujets: [exim-dev] [PATCH] Fix portability bugs in valgrind support., [exim-dev] [PATCH] Fix portability bugs in valgrind support.
Sujet: Re: [exim-dev] [Valgrind-users] [Bug 1050] [PATCH] Portability fixes for memcheck.h.
On Wed, 12 Jan 2011, Bart Van Assche wrote:
>
> Did you realize that with that patch you have broken
> VALGRIND_CHECK_MEM_IS_ADDRESSABLE() and several other macros ?


Ah, I missed that because exim only uses some valgrind macros as
statements not as expressions. Thanks for pointing it out.

I thought the __extension__ macro was supposed to be internal-only because
of the way it is defined in valgrind.h.

There is this code in valgrind.h

#if !defined(__GNUC__)
# define __extension__ /* */
#endif

which is clearly bogus because on non-gcc it leads to syntax errors in
many macros like the following and the ones I broke in memcheck.h

#define RUNNING_ON_VALGRIND  __extension__                        \
   ({unsigned int _qzz_res;                                       \
    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* if not */,          \
                               VG_USERREQ__RUNNING_ON_VALGRIND,   \
                               0, 0, 0, 0, 0);                    \
    _qzz_res;                                                     \
   })


I'm not immediately sure how to fix it properly.

Tony.
--
f.anthony.n.finch <dot@???> http://dotat.at/
HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7,
DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR
ROUGH. RAIN THEN FAIR. GOOD.