[compiler-rt] [compiler-rt]: fix CodeQL format-string warnings via explicit casts (PR #153843)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 10:15:10 PDT 2025


================
@@ -792,7 +792,7 @@ static void PrintNoOriginTrackingWarning() {
 
 static void PrintNoTaintWarning(const void *address) {
   Decorator d;
-  Printf("  %sDFSan: no tainted value at %x%s\n", d.Warning(), address,
+  Printf("  %sDFSan: no tainted value at %p%s\n", d.Warning(), (void*)address,
----------------
thurstond wrote:

> One other solution could change the %x to %lx which could be way better as now we can cast to uptr.

In sanitizers, it's more common to use `%zx`. Would that plus `uptr` satisfy CodeQL?

Another alternative is to leave out the DFSan change entirely from this patch. It won't be CodeQL clean, but then you could propose the "real" fix (`%p`) in a follow-up patch.

https://github.com/llvm/llvm-project/pull/153843


More information about the llvm-commits mailing list