aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2000-09-19 18:19:44 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2000-09-19 18:19:44 +0000
commitad3fd36f73012aa44ee7f55d09a2a2b87ce9dd6e (patch)
tree61dfe2eae6401356a44aaf263dd08431cc930e4e /gcc/tree.c
parent6f3d20a02285d63fa46862f6fffda3153956f246 (diff)
downloadgcc-ad3fd36f73012aa44ee7f55d09a2a2b87ce9dd6e.zip
gcc-ad3fd36f73012aa44ee7f55d09a2a2b87ce9dd6e.tar.gz
gcc-ad3fd36f73012aa44ee7f55d09a2a2b87ce9dd6e.tar.bz2
builtins.c (is_valid_printf_arglist, [...]): New functions.
* builtins.c (is_valid_printf_arglist, expand_builtin_printf): New functions. (expand_builtin_fputs): Set `target' parameter for `expand_expr'. (expand_builtin): Handle BUILT_IN_PUTCHAR, BUILT_IN_PUTS and BUILT_IN_PRINTF. * builtins.def (BUILT_IN_PUTCHAR, BUILT_IN_PUTS, BUILT_IN_PRINTF): New entries. * c-common.c (init_function_format_info): Handle __builtin_printf. Set `check_function_format_ptr'. (c_common_nodes_and_builtins): Set `puts_ftype' and `printf_ftype'. Declare __builtin_putchar, __builtin_puts, __builtin_printf and printf. * tree.c, tree.h (check_function_format_ptr): Declare. testsuite: * g++.old-deja/g++.other/virtual8.C: Declare printf correctly. From-SVN: r36540
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 3f8d7c6..ef27a78 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -246,6 +246,10 @@ static int next_decl_uid;
/* Unique id for next type created. */
static int next_type_uid = 1;
+/* Pointer to function to check the format of printf, etc. This is
+ used by the backend, e.g. builtins.c. */
+void (*check_function_format_ptr) PARAMS ((int *, tree, tree, tree)) = 0;
+
/* Here is how primitive or already-canonicalized types' hash
codes are made. */
#define TYPE_HASH(TYPE) ((unsigned long) (TYPE) & 0777777)