1 dnl AC_CHECK_PRINTF_NULL: Check whether printf("%s",NULL) works or segfault
2 dnl it uses AC_RUN and assume the worse while cross-compiling
5 dnl #ifndef PRINTF_NULL_WORKING
6 dnl # define PRINTF_STR(a) (a)?:"(null)"
8 dnl # define PRINTF_STR(a) (a)
11 dnl Copyright (C) 2005. Martin Quinson. All rights reserved.
13 dnl This file is part of the SimGrid project. This is free software: You can
14 dnl redistribute and/or modify it under the terms of GNU LGPL (v2.1) licence.
19 AC_DEFUN([AC_CHECK_PRINTF_NULL],
21 AC_MSG_CHECKING([whether printf("%s",NULL) works...])
22 AC_RUN_IFELSE(AC_LANG_PROGRAM([#include <stdio.h>],
23 [printf("%s",NULL);]),
24 AC_DEFINE(PRINTF_NULL_WORKING,
26 [Indicates whether printf("%s",NULL) works])
29 AC_MSG_RESULT(assuming the worse in cross-compilation))