Skip to content

Commit

Permalink
InjectPrintf strnlen issue fix
Browse files Browse the repository at this point in the history
Fix problem with strnlen warnings for linux builds
  • Loading branch information
ustachow authored and igcbot committed Dec 6, 2024
1 parent 7d8e178 commit f4a6bd2
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ InjectPrintf::InjectPrintf() : FunctionPass(ID) {
GlobalVariable* InjectPrintf::createGlobalFormatStr(Module* Module, LLVMContext& Context) {
IGC_ASSERT(Module != nullptr);

const char* FormatStrLiteral = "Pointer: %p, Type: %s\n";
size_t MaxLength = 256;
size_t FormatStrSize = strnlen(FormatStrLiteral, MaxLength) + 1;
const std::string FormatStrLiteral = "Pointer: %p, Type: %s\n";
size_t FormatStrSize = FormatStrLiteral.length() + 1;

GlobalVariable* FormatStrGlobal = new GlobalVariable(
*Module,
Expand Down

0 comments on commit f4a6bd2

Please sign in to comment.