]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix format specifier.
authorRobin Dapp <rdapp@oss.qualcomm.com>
Thu, 26 Mar 2026 15:19:43 +0000 (16:19 +0100)
committerRobin Dapp <robin.dapp@oss.qualcomm.com>
Mon, 18 May 2026 10:01:39 +0000 (12:01 +0200)
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.

gcc/config/riscv/riscv.cc

index 681b816d248eae1470a23484bf5fb1f826bee148..0fbc94297ca5e8661cac7a9aa793b770066a25ee 100644 (file)
@@ -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;
 }