From 5e5803060c3d6db3ff73195db798ffd8e5588e78 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Tue, 25 Jun 2019 09:41:17 +0000 Subject: Implement alternate "__intN__" form of "__intN" type gcc/ChangeLog: * gcc/c-family/c-common.c (c_common_nodes_and_builtins): Define alternate "__intN__" name for "__intN" types. * gcc/c/c-parser.c (c_parse_init): Create keyword for "__intN__" type. * gcc/cp/lex.c (init_reswords): Likewise. * gcc/config/msp430/msp430.h: Use __int20__ for SIZE_TYPE and PTRDIFF_TYPE. * gcc/cp/cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt". * gcc/c/c-decl.c (declspecs_add_type): Don't pedwarn about "__intN" ISO C incompatibility if alternate "__intN__" form is used. * gcc/cp/decl.c (grokdeclarator): Likewise. * gcc/cp/parser.c (cp_parser_simple_type_specifier): Set decl_specs->int_n_alt if "__intN__" form is used. * gcc/gimple-ssa-sprintf.c (build_intmax_type_nodes): Accept "__intN__" format of "__intN" types for UINTMAX_TYPE. * gcc/brig/brig-lang.c (brig_build_c_type_nodes): Accept "__intN__" format of "__intN" types for SIZE_TYPE. * gcc/lto/lto-lang.c (lto_build_c_type_nodes): Likewise. * gcc/stor-layout.c (initialize_sizetypes): Accept "__intN__" format of "__intN" types for SIZETYPE. * gcc/tree.c (build_common_tree_nodes): Accept "__intN__" format of "__intN" types for SIZE_TYPE and PTRDIFF_TYPE. * gcc/doc/invoke.texi: Document that __intN__ disables pedantic warnings. gcc/testsuite/ChangeLog: * gcc.target/msp430/mlarge-pedwarns.c: New test. From-SVN: r272640 --- gcc/lto/lto-lang.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/lto/lto-lang.c') diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index e155ea3..cc44afc 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -1259,10 +1259,12 @@ lto_build_c_type_nodes (void) for (i = 0; i < NUM_INT_N_ENTS; i++) if (int_n_enabled_p[i]) { - char name[50]; + char name[50], altname[50]; sprintf (name, "__int%d unsigned", int_n_data[i].bitsize); + sprintf (altname, "__int%d__ unsigned", int_n_data[i].bitsize); - if (strcmp (name, SIZE_TYPE) == 0) + if (strcmp (name, SIZE_TYPE) == 0 + || strcmp (altname, SIZE_TYPE) == 0) { intmax_type_node = int_n_trees[i].signed_type; uintmax_type_node = int_n_trees[i].unsigned_type; -- cgit v1.1