diff --git a/compiler-rt/lib/scudo/standalone/memtag.h b/compiler-rt/lib/scudo/standalone/memtag.h --- a/compiler-rt/lib/scudo/standalone/memtag.h +++ b/compiler-rt/lib/scudo/standalone/memtag.h @@ -41,6 +41,8 @@ inline constexpr bool archSupportsMemoryTagging() { return false; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-noreturn" inline uptr archMemoryTagGranuleSize() { UNREACHABLE("memory tagging not supported"); } @@ -54,6 +56,7 @@ (void)Ptr; UNREACHABLE("memory tagging not supported"); } +#pragma clang diagnostic pop #endif @@ -109,6 +112,8 @@ inline bool systemSupportsMemoryTagging() { return false; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-noreturn" inline bool systemDetectsMemoryTagFaultsTestOnly() { UNREACHABLE("memory tagging not supported"); } @@ -116,6 +121,7 @@ inline void enableSystemMemoryTaggingTestOnly() { UNREACHABLE("memory tagging not supported"); } +#pragma clang diagnostic pop #endif // SCUDO_LINUX @@ -255,6 +261,8 @@ #else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-noreturn" inline bool systemSupportsMemoryTagging() { UNREACHABLE("memory tagging not supported"); } @@ -298,6 +306,7 @@ (void)Ptr; UNREACHABLE("memory tagging not supported"); } +#pragma clang diagnostic pop #endif diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h --- a/compiler-rt/lib/scudo/standalone/secondary.h +++ b/compiler-rt/lib/scudo/standalone/secondary.h @@ -245,8 +245,11 @@ } } if (Found) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconditional-uninitialized" *H = reinterpret_cast( LargeBlock::addHeaderTag(HeaderPos)); +#pragma clang diagnostic pop *Zeroed = Entry.Time == 0; if (useMemoryTagging(Options)) setMemoryPermission(Entry.CommitBase, Entry.CommitSize, 0, &Entry.Data); @@ -395,7 +398,10 @@ atomic_s32 ReleaseToOsIntervalMs = {}; CachedBlock Entries[Config::SecondaryCacheEntriesArraySize] = {}; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wzero-length-array" CachedBlock Quarantine[Config::SecondaryCacheQuarantineSize] = {}; +#pragma clang diagnostic pop }; template class MapAllocator {