Move internal errno definitions to common to be shared by all sanitizers
and to be used by allocators.
Details
- Reviewers
eugenis
Diff Detail
- Build Status
Buildable 7985 Build 7985: arc lint + arc unit
Event Timeline
scudo_allocator.cpp could probably be changed here as well due to ENOMEM/EINVAL in scudoPosixMemalign.
lib/sanitizer_common/sanitizer_errno.inc | ||
---|---|---|
21 ↗ | (On Diff #105313) | Why 12, 16, 22? |
lib/sanitizer_common/sanitizer_errno.cc | ||
---|---|---|
26 | Add COMPILER_CHECK()s for other errno codes instead of the test. |
Also, .inc is used for non-headers that are included in other non-headers, while sanitizer_errno.inc is a regular header.
But it you get rid of the test, you won't need it anyway.
lib/sanitizer_common/sanitizer_errno.inc | ||
---|---|---|
21 ↗ | (On Diff #105313) | Cause I want literals instead of extern consts whenever possible. Was that the question? |
lib/sanitizer_common/sanitizer_errno.inc | ||
---|---|---|
21 ↗ | (On Diff #105313) | I was wondering whether these values are portable.. but they happen to be the same on my platform (NetBSD). Please ignore. |
It does not have header guards, it cannot be used anywhere else but in those two places, it does not seem like a regular header to me.
lib/sanitizer_common/sanitizer_errno.cc | ||
---|---|---|
26 | I cannot include sanitizer_errno.h here, it will conflict with errno.h | |
lib/sanitizer_common/sanitizer_errno.inc | ||
21 ↗ | (On Diff #105313) | Yep, that's what test was added for, to make sure they are the same. |
Add COMPILER_CHECK()s for other errno codes instead of the test.