This is an archive of the discontinued LLVM Phabricator instance.

Add __warn_memset_zero_len builtin as a workaround for glibc issue
ClosedPublic

Authored by serge-sans-paille on Jan 16 2020, 12:58 PM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2020, 12:58 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

@akhuang can you confirm this fixes your issue? I've tested locally and it works fine on my side.

This is very hacky, but it might be the least-bad alternative. I mean, we could change D71082 so it doesn't allow system headers to define memset, but that seems worse.

Please add a testcase.

Unit tests: pass. 61933 tests passed, 0 failed and 783 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

This is very hacky,

Yeah, I know...

but it might be the least-bad alternative. I mean, we could change D71082 so it doesn't allow system headers to define memset, but that seems worse.

Definitively

Please add a testcase.

Done

This revision is now accepted and ready to land.Jan 16 2020, 2:14 PM

@akhuang can you confirm this fixes your issue? I've tested locally and it works fine on my side.

Yes, this fixes the __warn_memset_zero_len issue, thanks!

Unit tests: pass. 61934 tests passed, 0 failed and 783 were skipped.

clang-tidy: unknown.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

joerg added a subscriber: joerg.Jan 16 2020, 4:17 PM

Can this be restricted to Linux?

We currently don't have any mechanism for restricting builtins to specific operating systems. I guess we could add one, but this change doesn't seem like a compelling argument to add that capability.

This revision was automatically updated to reflect the committed changes.