aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2003-06-22 08:05:39 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2003-06-22 08:05:39 +0000
commit0e9e3a8b78c5e8f59542d62945ec227fab3e8afd (patch)
treef82c7c3cc9a0ba4b01e4e7cdb5893707e20327c3 /gcc/diagnostic.c
parentad667abe549e76abaf248e470ceff39409440a8e (diff)
downloadgcc-0e9e3a8b78c5e8f59542d62945ec227fab3e8afd.zip
gcc-0e9e3a8b78c5e8f59542d62945ec227fab3e8afd.tar.gz
gcc-0e9e3a8b78c5e8f59542d62945ec227fab3e8afd.tar.bz2
diagnostic.h (output_host_wide_integer): Declare.
* diagnostic.h (output_host_wide_integer): Declare. * diagnostic.c (output_long_long_decicaml): New function. (output_host_wide_integer): Likewise. (output_format): Use them. Handle "%ll" and "%w". From-SVN: r68323
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 35fbb6f..ac7b9a0 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -335,6 +335,18 @@ output_long_hexadecimal (output_buffer *buffer, long unsigned int i)
}
static inline void
+output_long_long_decimal (output_buffer *buffer, long long int i)
+{
+ output_formatted_scalar (buffer, "%lld", i);
+}
+
+void
+output_host_wide_integer (output_buffer *buffer, HOST_WIDE_INT i)
+{
+ output_formatted_scalar (buffer, HOST_WIDE_INT_PRINT_DEC, i);
+}
+
+static inline void
output_pointer (output_buffer *buffer, void *p)
{
output_formatted_scalar (buffer, HOST_PTR_PRINTF, p);
@@ -457,6 +469,8 @@ output_buffer_to_stream (output_buffer *buffer)
%o: unsigned integer in base eight.
%x: unsigned integer in base sixteen.
%ld, %li, %lo, %lu, %lx: long versions of the above.
+ %ll: long long int.
+ %w: and integer of type HOST_WIDE_INT.
%c: character.
%s: string.
%p: pointer.
@@ -542,6 +556,15 @@ output_format (output_buffer *buffer, text_info *text)
(buffer, va_arg (*text->args_ptr, unsigned int));
break;
+ case 'l':
+ if (long_integer)
+ output_long_long_decimal
+ (buffer, va_arg (*text->args_ptr, long long));
+ else
+ /* Sould not happen. */
+ abort();
+ break;
+
case 'm':
output_add_string (buffer, xstrerror (text->err_no));
break;
@@ -575,6 +598,11 @@ output_format (output_buffer *buffer, text_info *text)
}
break;
+ case 'w':
+ output_host_wide_integer
+ (buffer, va_arg (*text->args_ptr, HOST_WIDE_INT));
+ break;
+
default:
if (!buffer->format_decoder
|| !(*buffer->format_decoder) (buffer, text))