Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD: fix build with nvc #1052

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions config/m4/configure.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# See file LICENSE for terms.
#

Expand Down Expand Up @@ -76,8 +76,14 @@ AC_ARG_ENABLE([debug],
AS_IF([test "x$enable_debug" = xyes],
[AS_MESSAGE([debug build])
AC_DEFINE([ENABLE_DEBUG], [1], [Enable debugging code])
CFLAGS="$CFLAGS -O0 -g3"
CXXFLAGS="$CXXFLAGS -O0 -g3"

Sergei-Lebedev marked this conversation as resolved.
Show resolved Hide resolved
# use -g3 if compiler supports it, otherwise just -g
CHECK_COMPILER_FLAG([-g3], [-g3],
[AC_LANG_SOURCE([[int main(int argc, char** argv){return 0;}]])],
[CFLAGS="$CFLAGS -O0 -g3"
CXXFLAGS="$CXXFLAGS -O0 -g3"],
[CFLAGS="$CFLAGS -O0 -g"
CXXFLAGS="$CXXFLAGS -O0 -g"])
AC_DEFINE([UCS_MAX_LOG_LEVEL], [UCS_LOG_LEVEL_TRACE_POLL], [Highest log level])],
[CFLAGS="$CFLAGS -O3 -g -DNDEBUG"
CXXFLAGS="$CXXFLAGS -O3 -g -DNDEBUG"
Expand Down
14 changes: 7 additions & 7 deletions src/utils/ucc_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,25 +919,25 @@ int ucc_config_sscanf_uint_ranged(const char *buf, void *dest,
return 0;
}

#define MAX_TMP_BUF_LENGTH 128
int ucc_config_sprintf_uint_ranged(char *buf, size_t max, const void *src,
const void *arg) // NOLINT
{
const ucc_mrange_uint_t *s = src;
const size_t tmp_max = 128;
ucc_mrange_t *r;
char tmp_start[tmp_max];
char tmp_end[tmp_max];
char tmp_mtypes[tmp_max];
char tmp_start[MAX_TMP_BUF_LENGTH];
char tmp_end[MAX_TMP_BUF_LENGTH];
char tmp_mtypes[MAX_TMP_BUF_LENGTH];
size_t last;

ucc_list_for_each(r, &s->ranges, list_elem) {
ucs_memunits_to_str(r->start, tmp_start, tmp_max);
ucs_memunits_to_str(r->end, tmp_end, tmp_max);
ucs_memunits_to_str(r->start, tmp_start, MAX_TMP_BUF_LENGTH);
ucs_memunits_to_str(r->end, tmp_end, MAX_TMP_BUF_LENGTH);
if (r->mtypes == UCC_MEM_TYPE_MASK_FULL) {
ucc_snprintf_safe(buf, max, "%s-%s:%u", tmp_start, tmp_end,
r->value);
} else {
ucc_mtype_map_to_str(r->mtypes, "^", tmp_mtypes, tmp_max);
ucc_mtype_map_to_str(r->mtypes, "^", tmp_mtypes, MAX_TMP_BUF_LENGTH);
ucc_snprintf_safe(buf, max, "%s-%s:%s:%u", tmp_start, tmp_end,
tmp_mtypes, r->value);
}
Expand Down
Loading