From 0c3ca5c34b809685bba4fd6a360912a8aefa9d12 Mon Sep 17 00:00:00 2001 From: rse Date: Thu, 14 Jun 2007 08:11:52 +0000 Subject: HAVE_MCHECK_H and HAVE_MTRACE are Autoconf AC_DEFINEs. Those are not permitted to be checked directly as values, as their value 1 is just set _IF_ the variable is defined. If the variable is not defined the plain use in an #if clause causes compiler warnings or even errors as this is invalid use. AC_DEFINE always have to be checked with defined() only except we can be sure that it is defined (but even then its value is always 1 and hence no need to check this, too) --- test1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test1.c') diff --git a/test1.c b/test1.c index 4819150..b1bf27a 100644 --- a/test1.c +++ b/test1.c @@ -185,7 +185,7 @@ int main(int argc, const char ** argv) int help = 0; int usage = 0; -#if HAVE_MCHECK_H && HAVE_MTRACE +#if defined(HAVE_MCHECK_H) && defined(HAVE_MTRACE) /*@-moduncon -noeffectuncon@*/ mtrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */ /*@=moduncon =noeffectuncon@*/ @@ -269,7 +269,7 @@ int main(int argc, const char ** argv) exit: optCon = poptFreeContext(optCon); -#if HAVE_MCHECK_H && HAVE_MTRACE +#if defined(HAVE_MCHECK_H) && defined(HAVE_MTRACE) /*@-moduncon -noeffectuncon@*/ muntrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */ /*@=moduncon =noeffectuncon@*/ -- cgit v1.2.1