aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-10 16:01:28 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-10 16:01:28 +0000
commitb65768d7bb7d88b3c43264447574090a24380598 (patch)
tree57676efac0fbd7993de8a8d608ff86ec3eb0d56b /configure.ac
parent17232f53135162cab6a3309f37597ee2d11a9aad (diff)
Solaris doesn't like outputting a NULL to a %s in format strings.
Detect all platforms that don't like that, either, and ensure that when documentation is missing, we pass a non-NULL pointer when outputting the corresponding documentation. (closes issue #16689) Reported by: bklang Patches: 20100209__issue16689__with_tests.diff.txt uploaded by tilghman (license 14) Review: https://reviewboard.asterisk.org/r/497/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246030 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ea0e3eb18..b093d0af6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -619,6 +619,18 @@ AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides at
AC_MSG_RESULT(no)
)
+# glibc, AFAIK, is the only C library that makes printing a NULL to a string safe.
+AC_MSG_CHECKING([if your system printf is NULL-safe.])
+AC_RUN_IFELSE(
+ AC_LANG_PROGRAM([#include <stdio.h>],
+ [printf("%s", NULL)]),
+ AC_DEFINE([HAVE_NULLSAFE_PRINTF], 1, [Define to 1 if your C library can safely print NULL to string formats.])
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no),
+ # It's unlikely an embedded system will have this.
+ AC_MSG_RESULT(unknown)
+)
+
AST_GCC_ATTRIBUTE(pure)
AST_GCC_ATTRIBUTE(malloc)
AST_GCC_ATTRIBUTE(const)