diff options
author | alx32 <103613512+alx32@users.noreply.github.com> | 2024-03-21 14:53:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-21 14:53:09 -0700 |
commit | e4a672ef85f76c3402b81640e1e83e5d3069d1b9 (patch) | |
tree | 5c9b74823e77cf36bafe025927f2b07ea5b846f6 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | b609a4d7ea8b716f5f0ec83d10945362f42e730d (diff) | |
download | llvm-e4a672ef85f76c3402b81640e1e83e5d3069d1b9.zip llvm-e4a672ef85f76c3402b81640e1e83e5d3069d1b9.tar.gz llvm-e4a672ef85f76c3402b81640e1e83e5d3069d1b9.tar.bz2 |
[lld][macho] Fix gcc category merging warning (#86091)
Fixing gcc warning regarding creating non-null-terminated string:
```
../../lld/MachO/ObjC.cpp:1226:10: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
1226 | strncpy(strData, str, len);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~
../../lld/MachO/ObjC.cpp: In member function 'void {anonymous}::ObjcCategoryMerger::emitAndLinkPointerList(lld::macho::Defined*, uint32_t, const {anonymous}::ObjcCategoryMerger::ClassExtensionInfo&, const {anonymous}::ObjcCategoryMerger::PointerListInfo&)':
../../lld/MachO/ObjC.cpp:1223:24: note: length computed here
1223 | uint32_t len = strlen(str);
| ~~~~~~^~~~~
```
This is not actually a bug, as `newSectionData` returns a
zero-initialized memory region, so the null terminator will be there.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions