summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
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)