[PATCH 07/12] build-sys: fix again UL_SCANF_TYPE_MODIFIER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>

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 <ruediger.meier@xxxxxxxxxxx>
---
 configure.ac | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8d808b7..0bfe28c 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],
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux