From: Julian Seward Date: Thu, 12 May 2005 09:04:06 +0000 (+0000) Subject: When constructing a LeakErr, the (Char*) .string field is abused to X-Git-Tag: svn/VALGRIND_3_0_0~642 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77bc562faff17f4a6dc63649c63453f76ace37b5;p=thirdparty%2Fvalgrind.git When constructing a LeakErr, the (Char*) .string field is abused to carry an Int. This is confusing but works on 32-bit platforms; on 64-bit ones, gcc complains about the cast. This commit adds another kludge to keep gcc quiet. Really this should be fixed properly. The casting-abuse is 'undone' in case LeakErr in MAC_(pp_Shared_Error). This should really be fixed properly. If this .string isn't always a string, perhaps it should be renamed 'auxword' and turned into a UWord which is guaranteed castable to/from pointer on any platform. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3676 --- diff --git a/memcheck/mac_leakcheck.c b/memcheck/mac_leakcheck.c index afea0734f7..c538bfd530 100644 --- a/memcheck/mac_leakcheck.c +++ b/memcheck/mac_leakcheck.c @@ -494,7 +494,10 @@ static void full_report(ThreadId tid) Unreached == p_min->loss_mode || Interior == p_min->loss_mode ); is_suppressed = VG_(unique_error) ( tid, LeakErr, (UInt)i+1, - (Char*)n_lossrecords, (void*) p_min, + /* HACK ALERT */ + ULong_to_Ptr((ULong)(UInt)n_lossrecords), + /* end HACK ALERT */ + (void*) p_min, p_min->allocated_at, print_record, /*allow_GDB_attach*/False, /*count_error*/False );