BITFIELD, /* Likewise but with specified width */
TYPENAME}; /* Typename (inside cast or sizeof) */
-#undef NULL
-#define NULL 0
-
#ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT
#endif
if (keep || functionbody
|| (current_binding_level->keep_if_subblocks && subblocks != 0))
- block = build_block (keep ? decls : 0, keep ? tags : 0,
- subblocks, 0, 0);
+ block = build_block (keep ? decls : NULL_TREE, keep ? tags : NULL_TREE,
+ subblocks, NULL_TREE, NULL_TREE);
/* In each subblock, record that this is its superior. */
us a convenient place to record the "scope start" address for the
tagged type. */
- TYPE_STUB_DECL (type) = pushdecl (build_decl (TYPE_DECL, NULL, type));
+ TYPE_STUB_DECL (type) = pushdecl (build_decl (TYPE_DECL, NULL_TREE, type));
}
\f
/* Handle when a new declaration NEWDECL
/* This is a no-op in c-lang.c or something real in objc-actions.c. */
maybe_objc_check_decl (decl);
- rest_of_decl_compilation (decl, 0, 0, 0);
+ rest_of_decl_compilation (decl, NULL_PTR, 0, 0);
if (warn_implicit && implicit_warning)
warning ("implicit declaration of function `%s'",
endlink = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
void_ftype_any
- = build_function_type (void_type_node, 0);
+ = build_function_type (void_type_node, NULL_TREE);
double_ftype_double
= build_function_type (double_type_node,
/* ``integer_tpe_node'' misspelling corrected: North-Keys 30 Mar 91 */
builtin_function ("__builtin_constant_p",
build_function_type (integer_type_node, endlink),
- BUILT_IN_CONSTANT_P, 0);
+ BUILT_IN_CONSTANT_P, NULL_PTR);
builtin_function ("__builtin_return_address",
build_function_type (integer_type_node,
tree_cons (NULL_TREE,
unsigned_type_node,
endlink)),
- BUILT_IN_RETURN_ADDRESS, 0);
+ BUILT_IN_RETURN_ADDRESS, NULL_PTR);
builtin_function ("__builtin_frame_address",
build_function_type (integer_type_node,
tree_cons (NULL_TREE,
unsigned_type_node,
endlink)),
- BUILT_IN_FRAME_ADDRESS, 0);
+ BUILT_IN_FRAME_ADDRESS, NULL_PTR);
builtin_function ("__builtin_alloca",
build_function_type (ptr_type_node,
tree_cons (NULL_TREE,
sizetype,
endlink)),
- BUILT_IN_ALLOCA, 0);
+ BUILT_IN_ALLOCA, NULL_PTR);
/* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1;
- temp = builtin_function ("_exit", void_ftype_any, NOT_BUILT_IN, 0);
+ temp = builtin_function ("_exit", void_ftype_any, NOT_BUILT_IN,
+ NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1;
/* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1;
}
- builtin_function ("__builtin_abs", int_ftype_int, BUILT_IN_ABS, 0);
- builtin_function ("__builtin_fabs", double_ftype_double, BUILT_IN_FABS, 0);
- builtin_function ("__builtin_labs", long_ftype_long, BUILT_IN_LABS, 0);
- builtin_function ("__builtin_ffs", int_ftype_int, BUILT_IN_FFS, 0);
+ builtin_function ("__builtin_abs", int_ftype_int, BUILT_IN_ABS, NULL_PTR);
+ builtin_function ("__builtin_fabs", double_ftype_double, BUILT_IN_FABS,
+ NULL_PTR);
+ builtin_function ("__builtin_labs", long_ftype_long, BUILT_IN_LABS,
+ NULL_PTR);
+ builtin_function ("__builtin_ffs", int_ftype_int, BUILT_IN_FFS, NULL_PTR);
builtin_function ("__builtin_saveregs", default_function_type,
- BUILT_IN_SAVEREGS, 0);
+ BUILT_IN_SAVEREGS, NULL_PTR);
/* EXPAND_BUILTIN_VARARGS is obsolete. */
#if 0
builtin_function ("__builtin_varargs",
tree_cons (NULL_TREE,
integer_type_node,
endlink)),
- BUILT_IN_VARARGS, 0);
+ BUILT_IN_VARARGS, NULL_PTR);
#endif
builtin_function ("__builtin_classify_type", default_function_type,
- BUILT_IN_CLASSIFY_TYPE, 0);
+ BUILT_IN_CLASSIFY_TYPE, NULL_PTR);
builtin_function ("__builtin_next_arg",
build_function_type (ptr_type_node, endlink),
- BUILT_IN_NEXT_ARG, 0);
+ BUILT_IN_NEXT_ARG, NULL_PTR);
builtin_function ("__builtin_args_info",
build_function_type (integer_type_node,
tree_cons (NULL_TREE,
integer_type_node,
endlink)),
- BUILT_IN_ARGS_INFO, 0);
+ BUILT_IN_ARGS_INFO, NULL_PTR);
/* Currently under experimentation. */
builtin_function ("__builtin_memcpy", memcpy_ftype,
However, honor the -fno-builtin option. */
if (!flag_no_builtin)
{
- builtin_function ("abs", int_ftype_int, BUILT_IN_ABS, 0);
- builtin_function ("fabs", double_ftype_double, BUILT_IN_FABS, 0);
- builtin_function ("labs", long_ftype_long, BUILT_IN_LABS, 0);
- builtin_function ("memcpy", memcpy_ftype, BUILT_IN_MEMCPY, 0);
- builtin_function ("memcmp", int_ftype_cptr_cptr_sizet, BUILT_IN_MEMCMP, 0);
- builtin_function ("strcmp", int_ftype_string_string, BUILT_IN_STRCMP, 0);
- builtin_function ("strcpy", string_ftype_ptr_ptr, BUILT_IN_STRCPY, 0);
- builtin_function ("strlen", strlen_ftype, BUILT_IN_STRLEN, 0);
- builtin_function ("sqrt", double_ftype_double, BUILT_IN_FSQRT, 0);
+ builtin_function ("abs", int_ftype_int, BUILT_IN_ABS, NULL_PTR);
+ builtin_function ("fabs", double_ftype_double, BUILT_IN_FABS, NULL_PTR);
+ builtin_function ("labs", long_ftype_long, BUILT_IN_LABS, NULL_PTR);
+ builtin_function ("memcpy", memcpy_ftype, BUILT_IN_MEMCPY, NULL_PTR);
+ builtin_function ("memcmp", int_ftype_cptr_cptr_sizet, BUILT_IN_MEMCMP,
+ NULL_PTR);
+ builtin_function ("strcmp", int_ftype_string_string, BUILT_IN_STRCMP,
+ NULL_PTR);
+ builtin_function ("strcpy", string_ftype_ptr_ptr, BUILT_IN_STRCPY,
+ NULL_PTR);
+ builtin_function ("strlen", strlen_ftype, BUILT_IN_STRLEN, NULL_PTR);
+ builtin_function ("sqrt", double_ftype_double, BUILT_IN_FSQRT, NULL_PTR);
/* Declare these functions volatile
to avoid spurious "control drops through" warnings. */
/* Don't specify the argument types, to avoid errors
from certain code which isn't valid in ANSI but which exists. */
- temp = builtin_function ("abort", void_ftype_any, NOT_BUILT_IN, 0);
+ temp = builtin_function ("abort", void_ftype_any, NOT_BUILT_IN,
+ NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1;
- temp = builtin_function ("exit", void_ftype_any, NOT_BUILT_IN, 0);
+ temp = builtin_function ("exit", void_ftype_any, NOT_BUILT_IN, NULL_PTR);
TREE_THIS_VOLATILE (temp) = 1;
TREE_SIDE_EFFECTS (temp) = 1;
}
#if 0
/* Support for these has not been written in either expand_builtin
or build_function_call. */
- builtin_function ("__builtin_div", default_ftype, BUILT_IN_DIV, 0);
- builtin_function ("__builtin_ldiv", default_ftype, BUILT_IN_LDIV, 0);
- builtin_function ("__builtin_ffloor", double_ftype_double, BUILT_IN_FFLOOR, 0);
- builtin_function ("__builtin_fceil", double_ftype_double, BUILT_IN_FCEIL, 0);
- builtin_function ("__builtin_fmod", double_ftype_double_double, BUILT_IN_FMOD, 0);
- builtin_function ("__builtin_frem", double_ftype_double_double, BUILT_IN_FREM, 0);
- builtin_function ("__builtin_memset", ptr_ftype_ptr_int_int, BUILT_IN_MEMSET, 0);
- builtin_function ("__builtin_getexp", double_ftype_double, BUILT_IN_GETEXP, 0);
- builtin_function ("__builtin_getman", double_ftype_double, BUILT_IN_GETMAN, 0);
+ builtin_function ("__builtin_div", default_ftype, BUILT_IN_DIV, NULL_PTR);
+ builtin_function ("__builtin_ldiv", default_ftype, BUILT_IN_LDIV, NULL_PTR);
+ builtin_function ("__builtin_ffloor", double_ftype_double, BUILT_IN_FFLOOR,
+ NULL_PTR);
+ builtin_function ("__builtin_fceil", double_ftype_double, BUILT_IN_FCEIL,
+ NULL_PTR);
+ builtin_function ("__builtin_fmod", double_ftype_double_double,
+ BUILT_IN_FMOD, NULL_PTR);
+ builtin_function ("__builtin_frem", double_ftype_double_double,
+ BUILT_IN_FREM, NULL_PTR);
+ builtin_function ("__builtin_memset", ptr_ftype_ptr_int_int,
+ BUILT_IN_MEMSET, NULL_PTR);
+ builtin_function ("__builtin_getexp", double_ftype_double, BUILT_IN_GETEXP,
+ NULL_PTR);
+ builtin_function ("__builtin_getman", double_ftype_double, BUILT_IN_GETMAN,
+ NULL_PTR);
#endif
/* Create the global bindings for __FUNCTION__ and __PRETTY_FUNCTION__. */
DECL_BUILT_IN_NONANSI (decl) = 1;
if (library_name)
DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
- make_decl_rtl (decl, 0, 1);
+ make_decl_rtl (decl, NULL_PTR, 1);
pushdecl (decl);
if (function_code != NOT_BUILT_IN)
{
{
/* This is a no-op in c-lang.c or something real in objc-actions.c. */
maybe_objc_check_decl (decl);
- rest_of_decl_compilation (decl, 0,
+ rest_of_decl_compilation (decl, NULL_PTR,
current_binding_level == global_binding_level,
0);
}
/* Omit the arg types if -traditional, since the arg types
and the list links might not be permanent. */
- type = build_function_type (type, flag_traditional ? 0 : arg_types);
+ type = build_function_type (type,
+ flag_traditional
+ ? NULL_TREE : arg_types);
#endif
type = build_function_type (type, arg_types);
declarator = TREE_OPERAND (declarator, 0);
value = grokdeclarator (declarator, declspecs, width ? BITFIELD : FIELD, 0);
- finish_decl (value, NULL, NULL);
+ finish_decl (value, NULL_TREE, NULL_TREE);
DECL_INITIAL (value) = width;
return value;
error_with_decl (x, "zero width for bit-field `%s'");
DECL_INITIAL (x) = NULL;
}
- else if (width > TYPE_PRECISION (TREE_TYPE (x)))
+ else if (width > TYPE_PRECISION (TREE_TYPE (x))
+ || TREE_INT_CST_HIGH (DECL_INITIAL (x)) != 0)
{
DECL_INITIAL (x) = NULL;
pedwarn_with_decl (x, "width of `%s' exceeds its type");
layout_decl (decl, 0);
/* This is a no-op in c-lang.c or something real in objc-actions.c. */
maybe_objc_check_decl (decl);
- rest_of_decl_compilation (decl, 0, toplevel, 0);
+ rest_of_decl_compilation (decl, NULL_PTR, toplevel, 0);
if (! toplevel)
expand_decl (decl);
--current_binding_level->n_incomplete;
{
register tree pair;
tree minnode = 0, maxnode = 0;
- register long maxvalue = 0;
- register long minvalue = 0;
+ register HOST_WIDE_INT maxvalue = 0;
+ register HOST_WIDE_INT minvalue = 0;
register int i;
unsigned precision = 0;
int toplevel = global_binding_level == current_binding_level;
precision = TYPE_PRECISION (long_long_integer_type_node);
else
{
- int maxvalue = TREE_INT_CST_LOW (maxnode);
- int minvalue = TREE_INT_CST_LOW (minnode);
+ maxvalue = TREE_INT_CST_LOW (maxnode);
+ minvalue = TREE_INT_CST_LOW (minnode);
if (maxvalue > 0)
precision = floor_log2 (maxvalue) + 1;
TREE_TYPE (value) = integer_type_node;
pushdecl (decl);
- return saveable_tree_cons (decl, value, NULL);
+ return saveable_tree_cons (decl, value, NULL_TREE);
}
\f
/* Create the FUNCTION_DECL for a function definition.
if (TREE_CODE (restype) == INTEGER_TYPE
&& TYPE_PRECISION (restype) < TYPE_PRECISION (integer_type_node))
restype = integer_type_node;
- DECL_RESULT (current_function_decl) = build_decl (RESULT_DECL, 0, restype);
+ DECL_RESULT (current_function_decl)
+ = build_decl (RESULT_DECL, NULL_TREE, restype);
if (!nested)
/* Allocate further tree nodes temporarily during compilation
for (parm = DECL_ARGUMENTS (fndecl); parm; parm = TREE_CHAIN (parm))
{
- type = perm_tree_cons (NULL, DECL_ARG_TYPE (parm), NULL);
+ type = perm_tree_cons (NULL_TREE, DECL_ARG_TYPE (parm),
+ NULL_TREE);
if (last)
TREE_CHAIN (last) = type;
else
actual = type;
last = type;
}
- type = perm_tree_cons (NULL, void_type_node, NULL);
+ type = perm_tree_cons (NULL_TREE, void_type_node, NULL_TREE);
if (last)
TREE_CHAIN (last) = type;
else
newargs = 0;
for (i = 0; i < len; i++)
- newargs = tree_cons (0, 0, newargs);
+ newargs = tree_cons (NULL_TREE, NULL_TREE, newargs);
n = newargs;
{
if (TYPE_SIZE (type) == 0)
{
- incomplete_type_error (0, type);
+ incomplete_type_error (NULL_TREE, type);
return error_mark_node;
}
parmval = default_conversion (parmval);
#endif
}
- result = tree_cons (0, parmval, result);
+ result = tree_cons (NULL_TREE, parmval, result);
}
else if (TREE_CODE (TREE_TYPE (val)) == REAL_TYPE
&& (TYPE_PRECISION (TREE_TYPE (val))
name = "";
return digest_init (type, build_nt (CONSTRUCTOR, NULL_TREE,
build_tree_list (field, value)),
- 0, 0, 0, name);
+ NULL_PTR, 0, 0, name);
}
error ("cast to union type from type not present in union");
return error_mark_node;
/* Digest the specified initializer into an expression. */
- value = digest_init (type, init, 0, TREE_STATIC (decl),
+ value = digest_init (type, init, NULL_PTR, TREE_STATIC (decl),
TREE_STATIC (decl) || pedantic,
IDENTIFIER_POINTER (DECL_NAME (decl)));
}
if (raw_constructor)
- result = process_init_constructor (type, inside_init, 0,
+ result = process_init_constructor (type, inside_init, NULL_PTR,
require_constant,
constructor_constant, ofwhat);
else if (tail != 0)
{
*tail = old_tail_contents;
- result = process_init_constructor (type, 0, tail,
+ result = process_init_constructor (type, NULL_TREE, tail,
require_constant,
constructor_constant, ofwhat);
}
{
if (raw_constructor)
return process_init_constructor (type, inside_init,
- 0, constructor_constant,
+ NULL_PTR, constructor_constant,
constructor_constant, ofwhat);
else if (tail != 0)
{
*tail = old_tail_contents;
- return process_init_constructor (type, 0, tail, constructor_constant,
+ return process_init_constructor (type, NULL_TREE, tail,
+ constructor_constant,
constructor_constant, ofwhat);
}
else if (flag_traditional)
/* Traditionally one can say `char x[100] = 0;'. */
return process_init_constructor (type,
- build_nt (CONSTRUCTOR, 0,
- tree_cons (0, inside_init, 0)),
- 0, constructor_constant,
+ build_nt (CONSTRUCTOR, NULL_TREE,
+ tree_cons (NULL_TREE,
+ inside_init,
+ NULL_TREE)),
+ NULL_PTR, constructor_constant,
constructor_constant, ofwhat);
}
TREE_VALUE (tail), &tail1,
/* Both of these are the same because
a value here is an elt overall. */
- constant_element, constant_element, 0);
+ constant_element, constant_element,
+ NULL_PTR);
});
if (tail1 != 0 && TREE_CODE (tail1) != TREE_LIST)
{
error_init (
"non-empty initializer for array%s of empty elements",
- " `%s'", 0);
+ " `%s'", NULL_PTR);
/* Just ignore what we were supposed to use. */
tail1 = 0;
}
push_member_name (IDENTIFIER_POINTER (DECL_NAME (field)));
next1 = digest_init (TREE_TYPE (field),
TREE_VALUE (tail), &tail1,
- constant_element, constant_element, 0);
+ constant_element, constant_element,
+ NULL_PTR);
});
if (tail1 != 0 && TREE_CODE (tail1) != TREE_LIST)
abort ();
push_member_name (IDENTIFIER_POINTER (DECL_NAME (field)));
next1 = digest_init (TREE_TYPE (field),
TREE_VALUE (tail), &tail1,
- constant_value, constant_element, 0);
+ constant_value, constant_element, NULL_PTR);
});
if (tail1 != 0 && TREE_CODE (tail1) != TREE_LIST)
abort ();
if (TREE_CODE (type) == UNION_TYPE)
{
pedwarn_init ("excess elements in union initializer%s",
- " after `%s'", 0);
+ " after `%s'", NULL_PTR);
}
else
{
pedwarn_init ("excess elements in aggregate initializer%s",
- " after `%s'", 0);
+ " after `%s'", NULL_PTR);
}
}
exp = default_conversion (exp);
type = TREE_TYPE (exp);
- index = get_unwidened (exp, 0);
+ index = get_unwidened (exp, NULL_TREE);
/* We can't strip a conversion from a signed type to an unsigned,
because if we did, int_fits_type_p would do the wrong thing
when checking case values for being in range,
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef NULL_PTR
+#define NULL_PTR (char *) NULL
+#endif
+
/* Exported declarations. */
char *xmalloc ();
perror_with_name (pend_files[i]);
return FAILURE_EXIT_CODE;
}
- finclude (fd, pend_files[i], &outbuf, 0, 0);
+ finclude (fd, pend_files[i], &outbuf, 0, NULL_PTR);
}
no_output--;
perror_with_name (pend_includes[i]);
return FAILURE_EXIT_CODE;
}
- finclude (fd, pend_includes[i], &outbuf, 0, 0);
+ finclude (fd, pend_includes[i], &outbuf, 0, NULL_PTR);
}
/* Scan the input, processing macros and directives. */
case '\"':
{
register U_CHAR *bp1
- = skip_quoted_string (xp - 1, bp, ip->lineno, 0, 0, 0);
+ = skip_quoted_string (xp - 1, bp, ip->lineno,
+ NULL_PTR, NULL_PTR, NULL_PTR);
while (xp != bp1)
if (*xp == '\\') {
if (*++xp != '\n')
HASHNODE *hp;
prec += 6;
- mdef = create_definition (prec, lineend, 0);
-
+ mdef = create_definition (prec, lineend, NULL_PTR);
+
if (mdef.defn == 0)
abort();
if (is_hor_space[*bp])
++bp; /* skip exactly one blank/tab char */
/* now everything from bp before limit is the definition. */
- defn = collect_expansion (bp, limit, -1, 0);
+ defn = collect_expansion (bp, limit, -1, NULL_PTR);
defn->args.argnames = (U_CHAR *) "";
}
break;
bp++;
} else if (*bp == '"' || *bp == '\'')
- bp = skip_quoted_string (bp, limit, 0, 0, 0, &eofp);
+ bp = skip_quoted_string (bp, limit, 0, NULL_PTR, NULL_PTR, &eofp);
else
while (! is_hor_space[*bp] && *bp != '(' && *bp != ')'
&& *bp != '"' && *bp != '\'' && bp != limit)
FILE_BUF *ip = &instack[indepth];
value = eval_if_expression (buf, limit - buf);
- conditional_skip (ip, value == 0, T_IF, 0);
+ conditional_skip (ip, value == 0, T_IF, NULL_PTR);
return 0;
}
break;
case '\"':
case '\'':
- bp = skip_quoted_string (bp - 1, endb, ip->lineno, &ip->lineno, 0, 0);
+ bp = skip_quoted_string (bp - 1, endb, ip->lineno, &ip->lineno,
+ NULL_PTR, NULL_PTR);
break;
case '\\':
/* Char after backslash loses its special meaning. */
case '\'':
{
int eofp = 0;
- p = skip_quoted_string (p - 1, limit, 0, 0, 0, &eofp);
+ p = skip_quoted_string (p - 1, limit, 0, NULL_PTR, NULL_PTR, &eofp);
if (eofp)
return ip->bufp = p;
}
parse_error = macarg (&args[i], rest_args);
}
else
- parse_error = macarg (0, 0);
+ parse_error = macarg (NULL_PTR, 0);
if (parse_error) {
error_with_line (line_for_error (start_line), parse_error);
break;
void
error (msg, arg1, arg2, arg3)
char *msg;
+ char *arg1, *arg2, *arg3;
{
int i;
FILE_BUF *ip = NULL;
void
warning (msg, arg1, arg2, arg3)
char *msg;
+ char *arg1, *arg2, *arg3;
{
int i;
FILE_BUF *ip = NULL;
error_with_line (line, msg, arg1, arg2, arg3)
int line;
char *msg;
+ char *arg1, *arg2, *arg3;
{
int i;
FILE_BUF *ip = NULL;
void
pedwarn (msg, arg1, arg2, arg3)
char *msg;
+ char *arg1, *arg2, *arg3;
{
if (pedantic_errors)
error (msg, arg1, arg2, arg3);
char *file;
int line;
char *msg;
+ char *arg1, *arg2, *arg3;
{
int i;
if (!pedantic_errors && inhibit_warnings)
if (*p != '\n')
putc (*p, of);
else if (*p == '\"' || *p =='\'') {
- U_CHAR *p1 = skip_quoted_string (p, limit, 0, 0, 0, 0);
+ U_CHAR *p1 = skip_quoted_string (p, limit, 0, NULL_PTR,
+ NULL_PTR, NULL_PTR);
fwrite (p, p1 - p, 1, of);
p = p1 - 1;
}
/* pass NULL as output ptr to do_define since we KNOW it never
does any output.... */
- do_assert (buf, buf + strlen (buf) , NULL, kt);
+ do_assert (buf, buf + strlen (buf) , NULL_PTR, kt);
--indepth;
}
\f