[compiler-rt] 036f963 - scudo: fix __attribute__((format))

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 13 04:44:15 PDT 2021


Author: Dmitry Vyukov
Date: 2021-08-13T13:44:12+02:00
New Revision: 036f963083f0416a15ada2120dec8abd9177a8af

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

LOG: scudo: fix __attribute__((format))

The attribute should be in the header on declaration.
It's almost pointless in the source file.

Depends on D107977.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D107978

Added: 
    

Modified: 
    compiler-rt/lib/scudo/scudo_utils.cpp
    compiler-rt/lib/scudo/scudo_utils.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/scudo_utils.cpp b/compiler-rt/lib/scudo/scudo_utils.cpp
index b7ce8f9158172..b0aef752c6793 100644
--- a/compiler-rt/lib/scudo/scudo_utils.cpp
+++ b/compiler-rt/lib/scudo/scudo_utils.cpp
@@ -39,7 +39,7 @@ extern int VSNPrintf(char *buff, int buff_length, const char *format,
 
 namespace __scudo {
 
-FORMAT(1, 2) void NORETURN dieWithMessage(const char *Format, ...) {
+void dieWithMessage(const char *Format, ...) {
   static const char ScudoError[] = "Scudo ERROR: ";
   static constexpr uptr PrefixSize = sizeof(ScudoError) - 1;
   // Our messages are tiny, 256 characters is more than enough.

diff  --git a/compiler-rt/lib/scudo/scudo_utils.h b/compiler-rt/lib/scudo/scudo_utils.h
index b657c69d9baff..5a9b32f0b234e 100644
--- a/compiler-rt/lib/scudo/scudo_utils.h
+++ b/compiler-rt/lib/scudo/scudo_utils.h
@@ -27,7 +27,7 @@ inline Dest bit_cast(const Source& source) {
   return dest;
 }
 
-void NORETURN dieWithMessage(const char *Format, ...);
+void dieWithMessage(const char *Format, ...) NORETURN FORMAT(1, 2);
 
 bool hasHardwareCRC32();
 


        


More information about the llvm-commits mailing list