agent++: bool always gets defined as int

Hi,
A bug in agent++ v4.7.0 configure.ac means NEED_DEFINE_BOOL always gets set to true, causing bool to be defined as int. The bug was introduced in agent++ v4.7.0 when AC_CXX_BOOL got renamed to AX_CXX_BOOL in configure.ac.
Following patch fixes the issue:

--- a/configure.ac
+++ b/configure.ac
@@ -246,7 +246,7 @@ AC_TYPE_PID_T
 AC_TYPE_UID_T
 AX_CXX_BOOL
 
-AS_IF([test "x$ac_cv_cxx_bool" = "xyes"], [NEED_DEFINE_BOOL=0], [NEED_DEFINE_BOOL=1])
+AS_IF([test "x$ax_cv_cxx_bool" = "xyes"], [NEED_DEFINE_BOOL=0], [NEED_DEFINE_BOOL=1])
 
 # Checks for libraries.
 AS_IF([test "x${acx_with_libsnmp}" != "xyes"], [AC_MSG_ERROR([libsnmp++ is mandatory and must not be disabled])])

Because a C++11 compatible compiler is required to build the code, a better fix might be to remove the check for build-in bool completely, as
it should never be necessary to define bool as int.

Best regards,

Holger

I have fixed this for the 4.7.1 release.

1 Like