Ответ 1
Не тратьте время на отладку
У вашей установки, вероятно, есть плохая сборка gcc или valgrind или просто не обновлена.
Я только что попробовал:
gcc -o junk /tmp/junk.cpp && ~/src/valgrind/coregrind/valgrind --leak-check=full --show-reachable=yes /tmp/junk
в следующем фрагменте
#include <stdio.h>
int main()
{
printf( "%.3f", 3.0 );
}
Конфигурация
- OSX 10.7.2
- Valgrind-3.7.0.SVN
-
gcc версия 4.2.1 (основано на Apple Inc. build 5658) (LLVM build 2335.15.00)
Использование встроенных спецификаций. Цель: i686-apple-darwin11 Настроено с помощью:/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-check --enable-werror --prefix =/Developer/usr/llvm-gcc-4.2 --mandir =/share/man --enable-languages = c, objc, С++, obj-С++ --program-prefix = llvm- --program-transform- name=/^ [cg] [^.-] * $/s/$/- 4.2/--with-slibdir =/usr/lib --build = i686-apple-darwin11 --enable-llvm =/private/var/tmp/llvmgcc42/llvmgcc42-2335.15 ~ 25/dst-llvmCore/Разработчик/usr/local --program-prefix = i686-apple-darwin11- --host = x86_64-apple-darwin11 --target = i686-apple-darwin11 --with-gxx-include-dir =/usr/include/С++/4.2.1 Модель резьбы: posix gcc версия 4.2.1 (основано на Apple Inc. build 5658) (LLVM build 2335.15.00)
Выход Valgrind
==58980== Memcheck, a memory error detector
==58980== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==58980== Using Valgrind-3.7.0.SVN and LibVEX; rerun with -h for copyright info
==58980== Command: /tmp/junk
==58980==
--58980-- /tmp/junk:
--58980-- dSYM directory is missing; consider using --dsymutil=yes
UNKNOWN task message [id 3229, to mach_task_self(), reply 0x2503]
UNKNOWN task message [id 3229, to mach_task_self(), reply 0x2503]
UNKNOWN task message [id 3414, to mach_task_self(), reply 0x2503]
--58980-- WARNING: unhandled syscall: unix:357
--58980-- You may be able to write your own handler.
--58980-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--58980-- Nevertheless we consider this a bug. Please report
--58980-- it at http://valgrind.org/support/bug_reports.html.
3.000==58980==
==58980== HEAP SUMMARY:
==58980== in use at exit: 0 bytes in 0 blocks
==58980== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==58980==
==58980== All heap blocks were freed -- no leaks are possible
==58980==
==58980== For counts of detected and suppressed errors, rerun with: -v
==58980== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)