autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to check callback prototypes?


From: Albert Chin
Subject: Re: how to check callback prototypes?
Date: Thu, 14 Jul 2005 22:49:02 -0500
User-agent: Mutt/1.5.6i

On Thu, Jul 14, 2005 at 12:23:21PM -0400, Sam Steingold wrote:
> when I pass a function with a wrong signature as a callback, I get just
> a warning from gcc, so the compile succeeds and the test is wrong:
> 
> AC_CACHE_CHECK([whether DB_ENV->set_errcall() accepts DBE],
> ac_cv_dbe_set_errcall_accept_dbe,[
> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <db.h>
> void my_callback (const DB_ENV* dbe, const char *errpfx, const char *msg) {}],
> [[DB_ENV dbe; dbe.set_errcall(&dbe,&my_callback);]])],
> ac_cv_dbe_set_errcall_accept_dbe=yes,ac_cv_dbe_set_errcall_accept_dbe=no)])
> if test "$ac_cv_dbe_set_errcall_accept_dbe" = "yes"; then
> AC_DEFINE(HAVE_DBE_SET_ERRCALL_ACCEPT_DBE,1,
> [Define to 1 if DB_ENV->set_errcall() accepts DBE])
> fi

How about testing if conftest.err is non-empty (warnings should be
included in it)?

-- 
albert chin (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]