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: https://origsvn.digium.com/svn/asterisk/trunk@246030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2010-02-10 16:01:28 +00:00
parent eaea15aa02
commit c8abb42e6a
4 changed files with 139 additions and 9 deletions

View File

@@ -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)