From 544d4069216539b730a952ba47d6471b96cdd72b Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Sun, 13 Mar 2016 03:19:26 +0100 Subject: build-sys: fix again UL_SCANF_TYPE_MODIFIER This reverts commit c8494d88: "build-sys: fix UL_SCANF_TYPE_MODIFIER for icc" plus fix the check prog, because it found "%as" to be valid on systems where "%a" is used for float conversion. icc warns about "%ms" but it works anyways. Our AC_RUN_IFELSE prog should do it right now regardless of compiler warnings. Note "%ms" is POSIX.1-2008 standard but still not available on many systems. Maybe it's time to remove "%as" fallback for old glibc which is even less portable. Signed-off-by: Ruediger Meier --- configure.ac | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8d808b7a0..0bfe28cc6 100644 --- a/configure.ac +++ b/configure.ac @@ -539,16 +539,15 @@ AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl int main() { int i; + int rc = 1; char *s; i = sscanf("x", $1, &s); + if (i == 1 && *s == 'x') + rc = 0; free(s); - if (i == 1) - return 0; - return 1; + return rc; }]) -ul_save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="-Werror ${CPPFLAGS}" AC_CACHE_VAL([scanf_cv_alloc_modifier], AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])], [scanf_cv_alloc_modifier=ms], @@ -582,7 +581,6 @@ AC_CACHE_VAL([scanf_cv_alloc_modifier], [scanf_cv_alloc_modifier=no])] ) ) -CPPFLAGS="$ul_save_CPPFLAGS" AC_MSG_CHECKING([scanf string alloc modifiers]) AS_CASE([$scanf_cv_alloc_modifier], -- cgit v1.2.3-55-g7522