From e3fff6f226714d15ecd144e99828cbdd25bc2bb5 Mon Sep 17 00:00:00 2001 From: jsm28 Date: Sun, 8 Oct 2000 21:20:45 +0000 Subject: * tm.texi (INTMAX_TYPE, UINTMAX_TYPE): Define. * c-common.h (enum c_tree_index): Add CTI_INTMAX_TYPE and CTI_UINTMAX_TYPE. (intmax_type_node, uintmax_type_node): Define. * c-common.c (decl_attributes): If pedantic, warn if `mode' attributes create a type wider than intmax_t. (T_IM, T_UIM): Define properly. * c-decl.c (INTMAX_TYPE, UINTMAX_TYPE): Define if not already defined. (init_decl_processing): Initialize intmax_type_node and uintmax_type_node. * c-lex.c (lex_number): When pedantic and warning for integer constants that are too large, in C99 mode warn for those that have a type wider than long long. cp: * decl.c (INTMAX_TYPE, UINTMAX_TYPE): Define if not already defined. (init_decl_processing): Initialize intmax_type_node and uintmax_type_node. testsuite: * gcc.dg/c99-printf-1.c, gcc.dg/c99-scanf-1.c, gcc.dg/c90-printf-2.c, gcc.dg/c90-scanf-2.c: Define intmax_t and uintmax_t using to emulate the compiler's internal logic. No longer XFAIL %j tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36791 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-decl.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 9dbaa284685..39e0b4a978c 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -77,6 +77,22 @@ enum decl_context #ifndef WINT_TYPE #define WINT_TYPE "unsigned int" #endif + +#ifndef INTMAX_TYPE +#define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "int" \ + : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "long int" \ + : "long long int")) +#endif + +#ifndef UINTMAX_TYPE +#define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "unsigned int" \ + : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "long unsigned int" \ + : "long long unsigned int")) +#endif /* Do GC. */ int ggc_p = 1; @@ -3078,6 +3094,11 @@ init_decl_processing () wint_type_node = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (WINT_TYPE))); + intmax_type_node = + TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (INTMAX_TYPE))); + uintmax_type_node = + TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (UINTMAX_TYPE))); + boolean_type_node = integer_type_node; boolean_true_node = integer_one_node; boolean_false_node = integer_zero_node; -- cgit v1.2.1