1 dnl AC_CHECK_PRINTF_NULL: Check whether printf("%s",NULL) works or segfault
3 dnl it uses AC_RUN and assume the worse while cross-compiling
6 dnl #ifndef PRINTF_NULL_WORKING
7 dnl # define PRINTF_STR(a) (a)?:"(null)"
9 dnl # define PRINTF_STR(a) (a)
12 AC_DEFUN([AC_CHECK_PRINTF_NULL],
14 AC_MSG_CHECKING([whether printf("%s",NULL) works...])
15 AC_RUN_IFELSE(AC_LANG_PROGRAM([#include <stdio.h>],
16 [printf("%s",NULL);]),
17 AC_DEFINE(PRINTF_NULL_WORKING,
19 [Indicates whether printf("%s",NULL) works])
22 AC_MSG_RESULT(assuming the worse in cross-compilation))