Fix few -Wformat-diag warnings.
authorMartin Liška <mliska@suse.cz>
Thu, 11 Jun 2020 08:43:36 +0000 (10:43 +0200)
committerMartin Liska <mliska@suse.cz>
Fri, 12 Jun 2020 07:32:53 +0000 (09:32 +0200)
Ready for master?

Thanks,
Martin

gcc/ChangeLog:

* cgraphunit.c (process_symver_attribute): Wrap weakref keyword.
* dbgcnt.c (dbg_cnt_set_limit_by_index): Do not print extra new
line.
* lto-wrapper.c (merge_and_complain): Wrap option names.

gcc/cgraphunit.c
gcc/dbgcnt.c
gcc/lto-wrapper.c

index 01b3f82a4b2a43d3c1b5153113613637cedf719a..ea9a34bda6fd317a2a7d761e44382e89fc2881a4 100644 (file)
@@ -762,7 +762,7 @@ process_symver_attribute (symtab_node *n)
   if (n->weakref)
     {
       error_at (DECL_SOURCE_LOCATION (n->decl),
-               "weakref cannot be versioned");
+               "%<weakref%> cannot be versioned");
       return;
     }
   if (!TREE_PUBLIC (n->decl))
index b0dd893ed490ac1f6c8ae6b7bd6c25fd83883d17..ae98a281d6351ceb14f2f54a3aa71a06365dabf7 100644 (file)
@@ -126,7 +126,7 @@ dbg_cnt_set_limit_by_index (enum debug_counter index, const char *name,
       if (t1.first <= t2.second)
        {
          error ("Interval overlap of %<-fdbg-cnt=%s%>: [%u, %u] and "
-                "[%u, %u]\n", name, t2.first, t2.second, t1.first, t1.second);
+                "[%u, %u]", name, t2.first, t2.second, t1.first, t1.second);
          return false;
        }
     }
index d565b0861f5a857bbffade8277d91fc2c863e737..8fbca7cabc4e8b90a3599583c20f916988c1f2f5 100644 (file)
@@ -508,24 +508,24 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
          break;
        else if (i < *decoded_options_count && j == fdecoded_options_count)
          {
-           warning (0, "Extra option to -Xassembler: %s,"
-                    " dropping all -Xassembler and -Wa options.",
+           warning (0, "Extra option to %<-Xassembler%>: %s,"
+                    " dropping all %<-Xassembler%> and %<-Wa%> options.",
                     (*decoded_options)[i].arg);
            xassembler_options_error = true;
            break;
          }
        else if (i == *decoded_options_count && j < fdecoded_options_count)
          {
-           warning (0, "Extra option to -Xassembler: %s,"
-                    " dropping all -Xassembler and -Wa options.",
+           warning (0, "Extra option to %<-Xassembler%>: %s,"
+                    " dropping all %<-Xassembler%> and %<-Wa%> options.",
                     fdecoded_options[j].arg);
            xassembler_options_error = true;
            break;
          }
        else if (strcmp ((*decoded_options)[i].arg, fdecoded_options[j].arg))
          {
-           warning (0, "Options to Xassembler do not match: %s, %s,"
-                    " dropping all -Xassembler and -Wa options.",
+           warning (0, "Options to %<-Xassembler%> do not match: %s, %s,"
+                    " dropping all %<-Xassembler%> and %<-Wa%> options.",
                     (*decoded_options)[i].arg, fdecoded_options[j].arg);
            xassembler_options_error = true;
            break;