diff options
author | Joseph Myers <jsm28@cam.ac.uk> | 2000-10-08 22:20:45 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2000-10-08 22:20:45 +0100 |
commit | b15ad712574a975b0ba2a333bff74db3f19c17d4 (patch) | |
tree | 15af4058397b150088ce3bdbb721fc90ed1842f9 /gcc/cp | |
parent | 2588e44e0019aac9b55c974efd69885eea663f54 (diff) | |
download | gcc-b15ad712574a975b0ba2a333bff74db3f19c17d4.zip gcc-b15ad712574a975b0ba2a333bff74db3f19c17d4.tar.gz gcc-b15ad712574a975b0ba2a333bff74db3f19c17d4.tar.bz2 |
tm.texi (INTMAX_TYPE, [...]): Define.
* 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 <limits.h> to emulate the compiler's internal
logic. No longer XFAIL %j tests.
From-SVN: r36791
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/decl.c | 21 |
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e7fdace..f0e2d4e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2000-10-08 Joseph S. Myers <jsm28@cam.ac.uk> + + * decl.c (INTMAX_TYPE, UINTMAX_TYPE): Define if not already + defined. + (init_decl_processing): Initialize intmax_type_node and + uintmax_type_node. + 2000-10-06 Richard Henderson <rth@cygnus.com> * cp-tree.h (struct cp_language_function): Remove x_result_rtx. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 82ebc36..16d6ebd 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -83,6 +83,22 @@ int ggc_p = 1; #define WCHAR_TYPE "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 + static tree grokparms PARAMS ((tree, int)); static const char *redeclaration_error_message PARAMS ((tree, tree)); @@ -6542,6 +6558,11 @@ init_decl_processing () wchar_array_type_node = build_array_type (wchar_type_node, array_domain_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))); + if (flag_vtable_thunks) { /* Make sure we get a unique function type, so we can give |