diff options
author | Karel Zak <kzak@redhat.com> | 2015-01-26 11:35:25 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2015-01-26 11:35:25 +0100 |
commit | a471a9e7803e324eedabf902375304e90f79eee7 (patch) | |
tree | 12f9913e56d6ead37a7d891f02d9b4a314fa3f07 | |
parent | 3d0b57d62cf289fed16537076018ba87d2d1c841 (diff) | |
parent | f205c90a72707591ad5342429d8e13fa69294ae2 (diff) | |
download | util-linux-playground-a471a9e7803e324eedabf902375304e90f79eee7.tar.gz |
Merge branch 'icc-fixes' of https://github.com/rudimeier/util-linux
* 'icc-fixes' of https://github.com/rudimeier/util-linux:
build: fix printf warnings for icc (-Wformat-security)
build-sys: fix UL_SCANF_TYPE_MODIFIER for icc
build-sys: free() needs stdlib.h
build-sys: avoid icc warnings "ignoring unknown option"
tests: python tests should not remove user's LD_LIBRARY_PATH
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | m4/compiler.m4 | 7 | ||||
-rw-r--r-- | sys-utils/ipcrm.c | 2 | ||||
-rw-r--r-- | sys-utils/lscpu.c | 8 | ||||
-rw-r--r-- | sys-utils/rtcwake.c | 2 | ||||
-rw-r--r-- | tests/functions.sh | 4 |
6 files changed, 19 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 3d77307fbd..a0d57631a3 100644 --- a/configure.ac +++ b/configure.ac @@ -480,6 +480,7 @@ AX_CHECK_TLS AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl # include <stdio.h> +# include <stdlib.h> int main() { int i; @@ -491,6 +492,8 @@ int main() return 1; }]) +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], @@ -524,6 +527,7 @@ 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], diff --git a/m4/compiler.m4 b/m4/compiler.m4 index 062f936230..058c73f069 100644 --- a/m4/compiler.m4 +++ b/m4/compiler.m4 @@ -21,11 +21,18 @@ AC_DEFUN([UL_WARN_ADD], [ m4_define([warnvarname], m4_default([$2],WARN_CFLAGS)) AS_VAR_PUSHDEF([ul_Warn], [ul_cv_warn_$1])dnl AC_CACHE_CHECK([whether compiler handles $1], m4_defn([ul_Warn]), [ + # store AC_LANG_WERROR status, then turn it on + save_ac_[]_AC_LANG_ABBREV[]_werror_flag="${ac_[]_AC_LANG_ABBREV[]_werror_flag}" + AC_LANG_WERROR + ul_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-Werror ${CPPFLAGS} $1" AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])], [AS_VAR_SET(ul_Warn, [yes])], [AS_VAR_SET(ul_Warn, [no])]) + # restore AC_LANG_WERROR + ac_[]_AC_LANG_ABBREV[]_werror_flag="${save_ac_[]_AC_LANG_ABBREV[]_werror_flag}" + CPPFLAGS="$ul_save_CPPFLAGS" ]) AS_VAR_IF(ul_Warn, [yes], [UL_AS_VAR_APPEND(warnvarname, [" $1"])]) diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c index 4b59217a6d..0b40f1539b 100644 --- a/sys-utils/ipcrm.c +++ b/sys-utils/ipcrm.c @@ -114,7 +114,7 @@ static int remove_id(int type, int iskey, int id) errmsg = iskey ? _("already removed key") : _("already removed id"); break; default: - err(EXIT_FAILURE, iskey ? _("key failed") : _("id failed")); + err(EXIT_FAILURE, "%s", iskey ? _("key failed") : _("id failed")); } warnx("%s (%d)", errmsg, id); return 1; diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 9b3adbcd58..82a7dbe05c 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -1242,20 +1242,20 @@ get_cell_data(struct lscpu_desc *desc, int idx, int col, if (!desc->configured) break; if (mod->mode == OUTPUT_PARSABLE) - snprintf(buf, bufsz, + snprintf(buf, bufsz, "%s", desc->configured[idx] ? _("Y") : _("N")); else - snprintf(buf, bufsz, + snprintf(buf, bufsz, "%s", desc->configured[idx] ? _("yes") : _("no")); break; case COL_ONLINE: if (!desc->online) break; if (mod->mode == OUTPUT_PARSABLE) - snprintf(buf, bufsz, + snprintf(buf, bufsz, "%s", is_cpu_online(desc, cpu) ? _("Y") : _("N")); else - snprintf(buf, bufsz, + snprintf(buf, bufsz, "%s", is_cpu_online(desc, cpu) ? _("yes") : _("no")); break; case COL_MAXMHZ: diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c index 35ca7e8938..bf99a5b8fa 100644 --- a/sys-utils/rtcwake.c +++ b/sys-utils/rtcwake.c @@ -492,7 +492,7 @@ int main(int argc, char **argv) } } if (verbose) - printf(clock_mode == CM_UTC ? _("Using UTC time.\n") : + printf("%s", clock_mode == CM_UTC ? _("Using UTC time.\n") : _("Using local time.\n")); if (!alarm && !seconds && strcmp(suspend,"disable") && diff --git a/tests/functions.sh b/tests/functions.sh index a9b37581db..852a6a3139 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -332,8 +332,8 @@ function ts_init_py { [ -f "$top_builddir/py${LIBNAME}.la" ] || ts_skip "py${LIBNAME} not compiled" - export LD_LIBRARY_PATH="$top_builddir/.libs" - export PYTHONPATH="$top_builddir/$LIBNAME/python:$top_builddir/.libs" + export LD_LIBRARY_PATH="$top_builddir/.libs:$LD_LIBRARY_PATH" + export PYTHONPATH="$top_builddir/$LIBNAME/python:$top_builddir/.libs:$PYTHONPATH" export PYTHON_VERSION=$(awk '/^PYTHON_VERSION/ { print $3 }' $top_builddir/Makefile) export PYTHON_MAJOR_VERSION=$(echo $PYTHON_VERSION | sed 's/\..*//') |