https://gcc.gnu.org/g:e63aa84edca4ef613c3e4f4dfe6afe3028d9d2b7

commit r17-565-ge63aa84edca4ef613c3e4f4dfe6afe3028d9d2b7
Author: Robin Dapp <[email protected]>
Date:   Thu Mar 26 16:19:43 2026 +0100

    RISC-V: Fix format specifier.
    
    Right now we get
    
    ../../gcc/config/riscv/riscv.cc: In function ‘bool 
riscv_check_target_clone_version(string_slice, location_t*)’:
    ../../gcc/config/riscv/riscv.cc:15078:17: warning: unknown conversion type 
character ‘B’ in format [-Wformat=]
    15078 |                 "invalid version %qB for %<target_clones%> 
attribute",
          |                 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../gcc/config/riscv/riscv.cc:15078:17: warning: too many arguments for 
format [-Wformat-extra-args]
    
    with a GCC 15 host compiler.
    
    This patch replaces %qB with $<%.*s%>.
    
    gcc/ChangeLog:
    
            * config/riscv/riscv.cc (riscv_check_target_clone_version): Fix
            format specifier.

Diff:
---
 gcc/config/riscv/riscv.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 681b816d248e..0fbc94297ca5 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -14488,8 +14488,8 @@ riscv_check_target_clone_version (string_slice str, 
location_t *loc_p)
 
   if (!ok && loc_p)
     warning_at (*loc_p, OPT_Wattributes,
-               "invalid version %qB for %<target_clones%> attribute",
-               &str);
+               "invalid version %<%.*s%> for %<target_clones%> attribute",
+               (int) str.size (), str.begin ());
 
   return ok;
 }

Reply via email to