ld signed overflow fix
[deliverable/binutils-gdb.git] / gdb / ui-out.c
index a64c79481cad9447880d68cf4043474df75b8193..80845f4bcaa8d61ee3e7c202b645831a8b22e8da 100644 (file)
@@ -26,6 +26,7 @@
 #include "ui-out.h"
 #include "gdbsupport/format.h"
 #include "cli/cli-style.h"
+#include "diagnostics.h"
 
 #include <vector>
 #include <memory>
@@ -587,7 +588,15 @@ ui_out::call_do_message (const ui_file_style &style, const char *format,
   va_list args;
 
   va_start (args, format);
+
+  /* Since call_do_message is only used as a helper of vmessage, silence the
+     warning here once instead of at all call sites in vmessage, if we were
+     to put a "format" attribute on call_do_message.  */
+  DIAGNOSTIC_PUSH
+  DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
   do_message (style, format, args);
+  DIAGNOSTIC_POP
+
   va_end (args);
 }
 
@@ -679,6 +688,24 @@ ui_out::vmessage (const ui_file_style &in_style, const char *format,
              }
          }
          break;
+       case size_t_arg:
+         {
+           size_t val = va_arg (args, size_t);
+           switch (piece.n_int_args)
+             {
+             case 0:
+               call_do_message (style, current_substring, val);
+               break;
+             case 1:
+               call_do_message (style, current_substring, intvals[0], val);
+               break;
+             case 2:
+               call_do_message (style, current_substring,
+                                intvals[0], intvals[1], val);
+               break;
+             }
+         }
+         break;
        case double_arg:
          call_do_message (style, current_substring, va_arg (args, double));
          break;
This page took 0.026281 seconds and 4 git commands to generate.