valgrind GCC mods for memcheck.h

Andreas Jaeger aj@suse.de
Sun Mar 2 16:23:00 GMT 2003


Hans-Peter Nilsson <hp@bitrange.com> writes:

> On Sun, 2 Mar 2003, Andreas Jaeger wrote:
>> +++ gcc/configure.in	2 Mar 2003 13:47:40 -0000
>> @@ -356,6 +356,8 @@ if test x$ac_checking_valgrind != x ; th
>>    # It is certainly possible that there's valgrind but no valgrind.h.
>>    # GCC relies on making annotations so we must have both.
>>    AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
>> +  AC_CHECK_HEADER(memcheck.h, [gcc_cv_header_memcheck_h=yes],
>> +		  [gcc_cv_header_memcheck_h=no])
>>    AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind,
>>  	[$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1])
>>    if test "x$valgrind_path" = "x" || test $have_valgrind_h = no; then
>> @@ -366,6 +368,10 @@ if test x$ac_checking_valgrind != x ; th
>>    AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
>>  [Define if you want to run subprograms and generated programs
>>     through valgrind (a memory checker).  This is extremely expensive.])
>> +  if test $gcc_cv_header_memcheck_h = yes; then
>> +    AC_DEFINE(HAVE_MEMCHECK_H, 1,
>> +	[Define if valgrind's memcheck.h header is installed.])
>> +  fi
>
> I suggested to check whether VALGRIND_DISCARD is in memcheck.h.
> I'm cautious about there being another header by that name,
> since IMHO it's not well chosen.  Perhaps I'm overcautious, but
> I want it on the table.

How do I check for a macro using autoconf this way?  Do you have some
suggestion to try?

Btw. bootstrapping does not work with current GCC anymore since the
usage of the valgrind macros generates warnings that are forbidden
now:

/cvs/gcc/gcc/ggc-common.c: In function `ggc_realloc':
/cvs/gcc/gcc/ggc-common.c:157: warning: traditional C rejects string concatenation
/cvs/gcc/gcc/ggc-common.c:157: warning: ISO C forbids braced-groups within expressions
/cvs/gcc/gcc/ggc-common.c:157: warning: ISO C forbids braced-groups within expressions
/cvs/gcc/gcc/ggc-common.c:158: warning: traditional C rejects string concatenation
/cvs/gcc/gcc/ggc-common.c:158: warning: ISO C forbids braced-groups within expressions
/cvs/gcc/gcc/ggc-common.c:158: warning: ISO C forbids braced-groups within expressions
/cvs/gcc/gcc/ggc-common.c:168: warning: traditional C rejects string concatenation
/cvs/gcc/gcc/ggc-common.c:168: warning: ISO C forbids braced-groups within expressions
/cvs/gcc/gcc/ggc-common.c:168: warning: ISO C forbids braced-groups within expressions
/cvs/gcc/gcc/ggc-common.c:173: warning: traditional C rejects string concatenation
/cvs/gcc/gcc/ggc-common.c:173: warning: ISO C forbids braced-groups within expressions
/cvs/gcc/gcc/ggc-common.c:173: warning: ISO C forbids braced-groups within expressions
make[2]: *** [ggc-common.o] Error 1

Any idea how to solve this issue?

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Gcc-patches mailing list