public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-2558] RISC-V: Suppress build warnings
@ 2022-09-09  9:53 Kito Cheng
  0 siblings, 0 replies; only message in thread
From: Kito Cheng @ 2022-09-09  9:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6aafd6b797d823fa4e888c36e08f9577137809c6

commit r13-2558-g6aafd6b797d823fa4e888c36e08f9577137809c6
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Fri Sep 9 16:39:08 2022 +0800

    RISC-V: Suppress build warnings
    
    ../../gcc/common/config/riscv/riscv-common.cc: In function 'const char* riscv_multi_lib_check(int, const char**)':
    ../../gcc/common/config/riscv/riscv-common.cc:1451:11: error: bare apostrophe ''' in format [-Werror=format-diag]
     1451 |       "Can't find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>",
          |           ^
    ../../gcc/common/config/riscv/riscv-common.cc:1451:7: note: if avoiding the apostrophe is not feasible, enclose it in a pair of '%<' and '%>' directives instead
     1451 |       "Can't find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>",
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../gcc/common/config/riscv/riscv-common.cc: At global scope:
    ../../gcc/common/config/riscv/riscv-common.cc:1492:1: error: 'int riscv_check_conds(const switchstr*, int, int, const std::vector<std::__cxx11::basic_string<char> >&)' defined but not used [-Werror=unused-function]
     1492 | riscv_check_conds (
          | ^~~~~~~~~~~~~~~~~
    ../../gcc/common/config/riscv/riscv-common.cc:1374:1: error: 'const char* find_last_appear_switch(const switchstr*, int, const char*)' defined but not used [-Werror=unused-function]
     1374 | find_last_appear_switch (
          | ^~~~~~~~~~~~~~~~~~~~~~~
    cc1plus: all warnings being treated as errors
    make[3]: *** [Makefile:2442: riscv-common.o] Error 1
    
    gcc/ChangeLog:
    
            * common/config/riscv/riscv-common.cc (RISCV_USE_CUSTOMISED_MULTI_LIB):
            Move forward for cover all all necessary functions for suppress
            unused function warnings.
            (riscv_multi_lib_check): Move forward, and tweak message to suppress
            -Werror=format-diag warning.

Diff:
---
 gcc/common/config/riscv/riscv-common.cc | 36 ++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index 120a0384686..77219162eeb 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -1366,6 +1366,24 @@ riscv_expand_arch_from_cpu (int argc ATTRIBUTE_UNUSED,
   return xasprintf ("-march=%s", arch.c_str());
 }
 
+/* Report error if not found suitable multilib.  */
+const char *
+riscv_multi_lib_check (int argc ATTRIBUTE_UNUSED,
+		       const char **argv ATTRIBUTE_UNUSED)
+{
+  if (riscv_no_matched_multi_lib)
+    fatal_error (
+      input_location,
+      "Cannot find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>",
+      riscv_current_arch_str.c_str (),
+      riscv_current_abi_str.c_str ());
+
+  return "";
+}
+
+/* We only override this in bare-metal toolchain.  */
+#ifdef RISCV_USE_CUSTOMISED_MULTI_LIB
+
 /* Find last switch with the prefix, options are take last one in general,
    return NULL if not found, and return the option value if found, it could
    return empty string if the option has no value.  */
@@ -1440,21 +1458,6 @@ riscv_multi_lib_info_t::parse (
   return true;
 }
 
-/* Report error if not found suitable multilib.  */
-const char *
-riscv_multi_lib_check (int argc ATTRIBUTE_UNUSED,
-		       const char **argv ATTRIBUTE_UNUSED)
-{
-  if (riscv_no_matched_multi_lib)
-    fatal_error (
-      input_location,
-      "Can't find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>",
-      riscv_current_arch_str.c_str (),
-      riscv_current_abi_str.c_str ());
-
-  return "";
-}
-
 /* Checking ARG is not appeared in SWITCHES if NOT_ARG is set or
    ARG is appeared if NOT_ARG is not set.  */
 
@@ -1534,9 +1537,6 @@ riscv_check_conds (
   return match_score + ok_count * 100;
 }
 
-/* We only override this in bare-metal toolchain.  */
-#ifdef RISCV_USE_CUSTOMISED_MULTI_LIB
-
 /* Implement TARGET_COMPUTE_MULTILIB.  */
 static const char *
 riscv_compute_multilib (

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-09  9:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  9:53 [gcc r13-2558] RISC-V: Suppress build warnings Kito Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).