Replace deprecated APIs in core/common#9825
Draft
hyunjiki-amd wants to merge 9 commits into
Draft
Conversation
stsoe
requested changes
May 19, 2026
Collaborator
|
Please also signoff |
stsoe
reviewed
May 19, 2026
[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
stsoe
reviewed
May 20, 2026
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
stsoe
approved these changes
May 21, 2026
| char *buf = formatStr + strlen(formatStr); | ||
| sprintf(buf, "%d", conversion.m_fieldWidthValue); | ||
| char *buf = &formatStr[pos]; | ||
| pos += sprintf(buf, "%d", conversion.m_fieldWidthValue); |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
pos += sprintf(buf, ".%d", conversion.m_precisionValue);
^
Collaborator
|
@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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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