Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit 691dfbf

Browse files
committed
log4tango: Fix snprintf test
The snprintf test was missing the declaration of the exit function. This never found a working system snprintf implementation. The fallout from this bug is that the LOG_* macros are not working as e.g. TangoTest returns 1453759720 [140389277255488] INFO tangotest/tt/1 TangoTest::init_device::init device Ready to accept request 1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook() TangoTest/tt/1 1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook() TangoTest/tt/1 1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook() TangoTest/tt/1 1453759720 [140389141108480] INFO tangotest/tt/1 TangoTest::always_executed_hook() TangoTest/tt/1 instead of 1453842671 [139686148966208] INFO tangotest/tt/1 TangoTest::init_device::init device TangoTest/tt/1 1453842671 [139686148966208] DEBUG tangotest/tt/1 sleep_period=2000 1453842671 [139686148966208] DEBUG tangotest/tt/1 mthreaded_impl=0 1453842671 [139686148966208] DEBUG tangotest/tt/1 uShort_image_ro_size=251 Ready to accept request 1453842671 [139685942777600] INFO tangotest/tt/1 TangoTest::always_executed_hook() TangoTest/tt/1 from the lines TangoTest.cpp: LOG_INFO(("TangoTest::init_device::init device %s", device_name.c_str())); TangoTest.cpp: LOG_DEBUG(("In read_attr_hardware for %d attributes",attr_list.size())); Original report from the author of this commit at [1]. [1]: https://www.tango-controls.org/community/forum/c/development/c/log_-macros-not-working/
1 parent 1ecbd77 commit 691dfbf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

log4tango/m4/AC_FUNC_SNPRINTF.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dnl
1313
AC_DEFUN([AC_FUNC_SNPRINTF],
1414
[AC_CACHE_CHECK(for working snprintf, ac_cv_func_snprintf,
1515
[AC_TRY_RUN([#include <stdio.h>
16+
#include <stdlib.h> // exit
1617
int main () { int l = snprintf(NULL,0,"%d",100); exit (!((3 <= l) || (-1 == l))); }
1718
], ac_cv_func_snprintf=yes, ac_cv_func_snprintf=no,
1819
ac_cv_func_snprintf=no)])

0 commit comments

Comments
 (0)