Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/lib/scudo/standalone/memtag.h | ||
---|---|---|
44 | can you avoid pragmas with NORETURN? | |
compiler-rt/lib/scudo/standalone/secondary.h | ||
247–274 ↗ | (On Diff #415977) | |
248 ↗ | (On Diff #415977) | Please don't mix different warning types in a single patch? |
400 ↗ | (On Diff #415977) | Can you avoid this by extractioing Quarantine with template specialization class <size_t Size> class Quarantine { doStuff1() {blocks...} doStuff2() {blocks...} private CachedBlock blocks[Size]; }; template<> class Quarantine<0> { doStuff1() {} doStuff2() {} } |
compiler-rt/lib/scudo/standalone/memtag.h | ||
---|---|---|
44 | Sorry, I don't understand the question. The UNREACHABLE macro calls the die() function that is labeled with NORETURN, which causes the compiler to warn about functions that don't return but that aren't labeled NORETURN. I can remove NORETURN from that function, but that would also require changing its' callers as well, such as dieOnMapUnmapError. | |
compiler-rt/lib/scudo/standalone/secondary.h | ||
247–274 ↗ | (On Diff #415977) | The issue is on HeaderPos; for some reason the compiler thinks it may be uninitialized. I can just initialize that to zero instead. |
400 ↗ | (On Diff #415977) | I'll split this off into another patch. |
zero-length-array in description is not needed
compiler-rt/lib/scudo/standalone/memtag.h | ||
---|---|---|
44 | I am asking about: If this does not suppress the warning then just Which compiler do you use? |
compiler-rt/lib/scudo/standalone/memtag.h | ||
---|---|---|
44 | Oh sorry I misunderstood. Yeah adding noreturn avoids most of the warnings, except for the one on setRandomTag. This is because that warning only gets emitted while compiling memtag_test.cpp, which does not include combined.h, which has the only non-fatal uses of setRandomTag. But it's not correct to declare it noreturn in general, because the other uses are not fatal. include/internal/scudo/memtag.h:305:62: error: function 'setRandomTag' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn] uptr *TaggedBegin, uptr *TaggedEnd) { ^ include/internal/scudo/memtag.h:308:1: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn] } |
compiler-rt/lib/scudo/standalone/memtag.h | ||
---|---|---|
44 | I don't like pragma there but NORETURN setRandomTag is incorrect. |
BTW, I suspect your fixes are going to regress with the time.
Would you like to update scudo_standalone cmake files so buildbots check these warnings?
Sure, I'll handle that in a follow-up. I'm not familiar with how the current build; are scudo/CMakeLists.txt and scudo/standalone/CMakeLists.txt separate projects? Are there instructions somewhere for just building standalone scudo instead of compiler-rt + scudo?
standalone is replacement of scudo which uses no stuff from compiler-rt/lib/sanitizer_common/
scudo (not scudo/standalone) should be deleted and @hctim has some pending patch, so ignore that one.
bots should do: ninja check-scudo_standalone
e.g. here https://lab.llvm.org/buildbot/#/builders/37/builds/11999
compiler-rt/lib/scudo/standalone/memtag.h | ||
---|---|---|
304 | These need to be wrapped in #if __clang__. This doesn't build with gcc + -Werror=unknown-pragmas |
compiler-rt/lib/scudo/standalone/memtag.h | ||
---|---|---|
304 | For warning switches that GCC also has, you should instead be using #pragma GCC diagnostic .... |
can you avoid pragmas with NORETURN?