From ff5283570135fd045e08d016eddf849b598d9e07 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Fri, 8 Sep 2017 09:10:44 -0700 Subject: [PATCH 1/3] subprocess: avoid enum in subprocess_manager_set Change prototype of subprocess_manager_set() to avoid using an enum as the argument passed to va_start(), as this causes warnings on newer compilers which complain about passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] The enum undergoes default promotion, and thus it may cause undefined behavior. Therefore, change the enum argument to an integer to avoid this warning. --- src/common/libsubprocess/subprocess.c | 2 +- src/common/libsubprocess/subprocess.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/libsubprocess/subprocess.c b/src/common/libsubprocess/subprocess.c index d40b0e4fdb66..01a5d5eba27d 100644 --- a/src/common/libsubprocess/subprocess.c +++ b/src/common/libsubprocess/subprocess.c @@ -1082,7 +1082,7 @@ subprocess_manager_reap_all (struct subprocess_manager *sm) } int -subprocess_manager_set (struct subprocess_manager *sm, sm_item_t item, ...) +subprocess_manager_set (struct subprocess_manager *sm, int item, ...) { va_list ap; diff --git a/src/common/libsubprocess/subprocess.h b/src/common/libsubprocess/subprocess.h index bb96e058f0bf..7a80beebc938 100644 --- a/src/common/libsubprocess/subprocess.h +++ b/src/common/libsubprocess/subprocess.h @@ -66,8 +66,7 @@ struct subprocess_manager * subprocess_manager_create (void); /* * Set value for item [item] in subprocess manager [sm] */ -int subprocess_manager_set (struct subprocess_manager *sm, - sm_item_t item, ...); +int subprocess_manager_set (struct subprocess_manager *sm, int item, ...); /* * Free memory associated with a subprocess manager object: From e6c66605619f6f10de2f8d95b0fbbc6b57a6223c Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Fri, 8 Sep 2017 10:14:32 -0700 Subject: [PATCH 2/3] optparse: avoid enum in optparse_get/set Change prototype of optparse_get() and optparse_set() to avoid passing an enum as the argument to va_start() in these variadic functions. Use of enum causes newer compiler to issue warnings of the form: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] Change the enum argument in these functions to an integer to suppress the warning and avoid potential undefined behavior. --- src/common/liboptparse/optparse.c | 4 ++-- src/common/liboptparse/optparse.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/liboptparse/optparse.c b/src/common/liboptparse/optparse.c index a4460a6c7604..0cfef4a5dac9 100644 --- a/src/common/liboptparse/optparse.c +++ b/src/common/liboptparse/optparse.c @@ -995,7 +995,7 @@ optparse_err_t optparse_add_doc (optparse_t *p, const char *doc, int group) return optparse_add_option (p, &o); } -optparse_err_t optparse_set (optparse_t *p, optparse_item_t item, ...) +optparse_err_t optparse_set (optparse_t *p, int item, ...) { optparse_err_t e = OPTPARSE_SUCCESS; va_list vargs; @@ -1074,7 +1074,7 @@ static void * lookup_recursive (optparse_t *p, const char *key) } -optparse_err_t optparse_get (optparse_t *p, optparse_item_t item, ...) +optparse_err_t optparse_get (optparse_t *p, int item, ...) { optparse_err_t e = OPTPARSE_SUCCESS; va_list vargs; diff --git a/src/common/liboptparse/optparse.h b/src/common/liboptparse/optparse.h index 49ebab82a5f7..edfa99010da5 100644 --- a/src/common/liboptparse/optparse.h +++ b/src/common/liboptparse/optparse.h @@ -243,9 +243,9 @@ optparse_err_t optparse_add_option_table (optparse_t *p, */ optparse_err_t optparse_add_doc (optparse_t *p, const char *doc, int group); -optparse_err_t optparse_set (optparse_t *p, optparse_item_t item, ...); +optparse_err_t optparse_set (optparse_t *p, int item, ...); -optparse_err_t optparse_get (optparse_t *p, optparse_item_t item, ...); +optparse_err_t optparse_get (optparse_t *p, int item, ...); /* Set and get arbitrary ancillary data associated with an optparse * object. optparse_get_data () returns NULL if data not found. From d2064316fa6a385c6be92b378b7737d78bc3f559 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Fri, 8 Sep 2017 11:01:37 -0700 Subject: [PATCH 3/3] travis-ci: update to latest libfaketime git sha1 Update to latest upstream version of libfaketime. Also, libfaketime doesn't appear to work with recent versions of clang. Force use of GCC. --- src/test/travis-dep-builder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/travis-dep-builder.sh b/src/test/travis-dep-builder.sh index a12f5494f5d5..69d760c30ed7 100755 --- a/src/test/travis-dep-builder.sh +++ b/src/test/travis-dep-builder.sh @@ -31,13 +31,13 @@ https://github.com/danmar/cppcheck.git \ https://github.com/LLNL/Caliper.git" declare -A checkout_sha1=(\ -["libfaketime"]="b68f2820c4091075fbc205965ec6976f6d241aaa" \ +["libfaketime"]="5d41d41da8f67e396f630280b180cdfb8e56abbc" \ ["cppcheck"]="7466a49b216d4ba5e25b48381d85a8c3b2d3a228" \ ["Caliper"]="be6b488bedb75012e60d3062f8cd2749032985fe" \ ) declare -A extra_make_opts=(\ -["libfaketime"]="LIBDIRNAME=/lib" +["libfaketime"]="LIBDIRNAME=/lib CC=gcc" ["cppcheck"]="CFGDIR=/${prefix}/etc/cppcheck CXX=g++ CC=gcc" )