This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[wide-int]: Bump up buffer for printing


The buffer was too small… The print routines when printing in hex, use the precision to form the output, and negative numbers have a few more ffffs in front than we might otherwise expect for the largest in on the machine.

Ok?

diff --git a/gcc/wide-int-print.h b/gcc/wide-int-print.h
index be93cd1..af07517 100644
--- a/gcc/wide-int-print.h
+++ b/gcc/wide-int-print.h
@@ -23,7 +23,8 @@ along with GCC; see the file COPYING3.  If not see
 #include <stdio.h>
 #include "wide-int.h"

-#define WIDE_INT_PRINT_BUFFER_SIZE (MAX_BITSIZE_MODE_ANY_INT / 4 + 4)
+#define WIDE_INT_PRINT_BUFFER_SIZE (WIDE_INT_MAX_PRECISION / 4 + 4)
+
 /* Printing functions.  */

 extern void print_dec (const wide_int &wi, char *buf, signop sgn);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]