Skip to content

Replace deprecated APIs in core/common#9825

Draft
hyunjiki-amd wants to merge 9 commits into
Xilinx:masterfrom
hyunjiki-amd:banned-api
Draft

Replace deprecated APIs in core/common#9825
hyunjiki-amd wants to merge 9 commits into
Xilinx:masterfrom
hyunjiki-amd:banned-api

Conversation

@hyunjiki-amd
Copy link
Copy Markdown
Collaborator

@hyunjiki-amd hyunjiki-amd commented May 19, 2026

Problem solved by the commit

To meet the driver compliance, banned APIs must be replaced according to https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/28719-banned-api-usage-use-updated-function-replacement

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

Issue fixed: driver compliance

How problem was solved, alternative solutions (if any) and why they were rejected

Replace deprecated APIs in core/common (e.g., strncpy to memcpy)

Risks (if any) associated the changes in the commit

None

What has been tested and how, request additional testing if necessary

Confirmed that the build is successful with the changes locally

Documentation impact (if any)

None

Signed-off-by: Hyunji Kim Hyunji.Kim@amd.com

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
@stsoe
Copy link
Copy Markdown
Collaborator

stsoe commented May 19, 2026

Please also signoff

Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
[why]
*_s variants won't work if dest is a pointer, need to detect the array case

[how]
Use template to handle array case and revert to std:: functions if it's a pointer
@hyunjiki-amd hyunjiki-amd reopened this May 20, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/core/common/api/xrt_error.cpp Outdated
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Comment thread src/runtime_src/core/common/str_wrapper.cpp Outdated
Comment thread src/runtime_src/core/common/str_wrapper.h Outdated
Comment thread src/runtime_src/xocl/api/printf/rt_printf_impl.cpp Outdated
Comment thread src/runtime_src/xocl/api/printf/rt_printf_impl.cpp Outdated
Comment thread src/runtime_src/xocl/api/printf/rt_printf_impl.cpp Outdated
Comment thread src/runtime_src/xocl/api/printf/rt_printf_impl.cpp Outdated
Comment thread src/runtime_src/xocl/api/printf/rt_printf_impl.cpp Outdated
Comment thread src/runtime_src/xocl/api/printf/rt_printf_impl.cpp Outdated
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/api/xrt_xclbin.cpp
@hyunjiki-amd hyunjiki-amd marked this pull request as ready for review May 20, 2026 22:33
@hyunjiki-amd hyunjiki-amd changed the title Replace Banned APIs Replace deprecated APIs in core/commons May 20, 2026
@hyunjiki-amd hyunjiki-amd changed the title Replace deprecated APIs in core/commons Replace deprecated APIs in core/common May 20, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

char *buf = formatStr + strlen(formatStr);
sprintf(buf, "%d", conversion.m_fieldWidthValue);
char *buf = &formatStr[pos];
pos += sprintf(buf, "%d", conversion.m_fieldWidthValue);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]

    pos += sprintf(buf, "%d", conversion.m_fieldWidthValue);
           ^

char *buf = formatStr + strlen(formatStr);
sprintf(buf, ".%d", conversion.m_precisionValue);
char *buf = &formatStr[pos];
pos += sprintf(buf, ".%d", conversion.m_precisionValue);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]

    pos += sprintf(buf, ".%d", conversion.m_precisionValue);
           ^

@stsoe
Copy link
Copy Markdown
Collaborator

stsoe commented May 25, 2026

@hyunjiki-amd . I think rt_printf_impl can be implemented in terms of std::string instead of c-style arrays? I would like to make these rt_printf_impl changes in a separate PR because I think your other changes to xrt_error.cpp and xrt_xclbin.cpp are clean. I just don't understand why CI is failing repeatedly?

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/api/xrt_xclbin.cpp
@hyunjiki-amd hyunjiki-amd reopened this May 25, 2026
@hyunjiki-amd hyunjiki-amd reopened this May 27, 2026
@hyunjiki-amd hyunjiki-amd marked this pull request as draft May 27, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants