From b1101e65b84693324c9c03b0c26b4feecdcc9d7e Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 17 Jan 2024 09:06:05 +0000 Subject: [PATCH 1/4] DAOS-14981 gurt: restore d_getenv_int undefined symbol Restore missing plain function d_getenv_int() to fix missing symbol with libdaos. Features: mpiio dfuse Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/gurt/misc.c | 15 +++++++++++++++ src/include/gurt/common.h | 10 +++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/gurt/misc.c b/src/gurt/misc.c index ffb1a85bb0d..3b287ca73ff 100644 --- a/src/gurt/misc.c +++ b/src/gurt/misc.c @@ -1302,6 +1302,21 @@ d_getenv_uint(const char *name, unsigned *uint_val) return -DER_SUCCESS; } +/** + * get an unsigned integer type environment variables. + * + * \param[in] name name of the environment variable. + * \param[in,out] uint_val returned value of the ENV. Will not change the original + * value if ENV is not set or set as a non-integer value. + * \return 0 on success, a negative value on error. + * \deprecated d_getenv_int() is deprecated, please use d_getenv_uint(). + */ +int +d_getenv_int(const char *name, unsigned *uint_val) +{ + return d_getenv_uint(name, uint_val); +} + /** * get a 32bits unsigned integer type environment variables * diff --git a/src/include/gurt/common.h b/src/include/gurt/common.h index 779a547768b..fa1de3b1b41 100644 --- a/src/include/gurt/common.h +++ b/src/include/gurt/common.h @@ -586,6 +586,9 @@ int d_getenv_bool(const char *name, bool *bool_val); int d_getenv_char(const char *name, char *char_val); +/* DAOS-14981 XXX d_getenv_int() is deprecated, please use d_getenv_uint() */ +int +d_getenv_int(const char *name, unsigned int *uint_val); int d_getenv_uint(const char *name, unsigned int *uint_val); int @@ -601,13 +604,6 @@ d_unsetenv(const char *name); int d_clearenv(void); -static inline int -d_getenv_int(const char *name, unsigned int *uint_val) -{ - D_WARN("d_getenv_int() is deprecated, please use d_getenv_uint()"); - return d_getenv_uint(name, uint_val); -} - int d_write_string_buffer(struct d_string_buffer_t *buf, const char *fmt, ...); void From e95531c0de297d42cdb888cb34db66305a34003c Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 17 Jan 2024 13:45:23 +0000 Subject: [PATCH 2/4] DAOS-14981 gurt: restore d_getenv_int undefined symbol Integrate reviewers comments: - Use compiler intrinsic macro Features: mpiio dfuse Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/include/gurt/common.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/include/gurt/common.h b/src/include/gurt/common.h index fa1de3b1b41..b14ba300458 100644 --- a/src/include/gurt/common.h +++ b/src/include/gurt/common.h @@ -586,9 +586,8 @@ int d_getenv_bool(const char *name, bool *bool_val); int d_getenv_char(const char *name, char *char_val); -/* DAOS-14981 XXX d_getenv_int() is deprecated, please use d_getenv_uint() */ int -d_getenv_int(const char *name, unsigned int *uint_val); +d_getenv_int(const char *name, unsigned int *uint_val) __attribute__ ((deprecated ("use d_getenv_uint"))); int d_getenv_uint(const char *name, unsigned int *uint_val); int From 8017cbebc81adcd829be167d18cc5614d2f1bdeb Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 17 Jan 2024 13:45:23 +0000 Subject: [PATCH 3/4] DAOS-14981 gurt: restore d_getenv_int undefined symbol Fix clang-format coding style. Features: mpiio dfuse Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/include/gurt/common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/gurt/common.h b/src/include/gurt/common.h index b14ba300458..3fc608436c9 100644 --- a/src/include/gurt/common.h +++ b/src/include/gurt/common.h @@ -587,7 +587,8 @@ d_getenv_bool(const char *name, bool *bool_val); int d_getenv_char(const char *name, char *char_val); int -d_getenv_int(const char *name, unsigned int *uint_val) __attribute__ ((deprecated ("use d_getenv_uint"))); +d_getenv_int(const char *name, unsigned int *uint_val) + __attribute__ ((deprecated ("use d_getenv_uint"))); int d_getenv_uint(const char *name, unsigned int *uint_val); int From 981d4a13eb7d259446a9258afe3750afc6cd12ec Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Wed, 17 Jan 2024 13:45:23 +0000 Subject: [PATCH 4/4] DAOS-14981 gurt: restore d_getenv_int undefined symbol Fix clang-format coding style. Features: mpiio dfuse Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/include/gurt/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/gurt/common.h b/src/include/gurt/common.h index 3fc608436c9..1cf40fc3292 100644 --- a/src/include/gurt/common.h +++ b/src/include/gurt/common.h @@ -588,7 +588,7 @@ int d_getenv_char(const char *name, char *char_val); int d_getenv_int(const char *name, unsigned int *uint_val) - __attribute__ ((deprecated ("use d_getenv_uint"))); + __attribute__((deprecated("use d_getenv_uint"))); int d_getenv_uint(const char *name, unsigned int *uint_val); int