[compiler-rt] d58fb40 - [compiler-rt][asan] Silence warning

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 09:29:46 PDT 2023


Author: Alexandre Ganea
Date: 2023-10-02T12:29:29-04:00
New Revision: d58fb40670ea9fb7f55e68267a5536daa974da85

URL: https://github.com/llvm/llvm-project/commit/d58fb40670ea9fb7f55e68267a5536daa974da85
DIFF: https://github.com/llvm/llvm-project/commit/d58fb40670ea9fb7f55e68267a5536daa974da85.diff

LOG: [compiler-rt][asan] Silence warning

This would silence:
```
[2003/2029] Generating ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cpp.x86_64-inline.o
In file included from C:/git/llvm-project/compiler-rt/lib/asan/tests/asan_noinst_test.cpp:24:
In file included from C:/git/llvm-project/compiler-rt/lib/asan\asan_allocator.h:20:
In file included from C:/git/llvm-project/compiler-rt/lib\sanitizer_common/sanitizer_allocator.h:74:
C:/git/llvm-project/compiler-rt/lib\sanitizer_common\sanitizer_allocator_primary64.h:639:54: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
  639 |   static_assert(kRegionSize >= SizeClassMap::kMaxSize);
      |                                                      ^
      |                                                      , ""
1 warning generated.
```

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
index fa43ac50c61e4f4..d77bc05b780203b 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
@@ -636,7 +636,8 @@ class SizeClassAllocator64 {
   }
   uptr SpaceEnd() const { return  SpaceBeg() + kSpaceSize; }
   // kRegionSize should be able to satisfy the largest size class.
-  static_assert(kRegionSize >= SizeClassMap::kMaxSize);
+  static_assert(kRegionSize >= SizeClassMap::kMaxSize,
+                "Region size exceed largest size");
   // kRegionSize must be <= 2^36, see CompactPtrT.
   COMPILER_CHECK((kRegionSize) <= (1ULL << (SANITIZER_WORDSIZE / 2 + 4)));
   // Call mmap for user memory with at least this size.


        


More information about the llvm-commits mailing list