]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix again UL_SCANF_TYPE_MODIFIER
authorRuediger Meier <ruediger.meier@ga-group.nl>
Sun, 13 Mar 2016 02:19:26 +0000 (03:19 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Sun, 13 Mar 2016 20:47:57 +0000 (21:47 +0100)
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@ga-group.nl>
configure.ac

index 8d808b7a03291d361db600e72ff5f3084ef05d45..0bfe28cc68da653f65090210297005923f8aa510 100644 (file)
@@ -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],