expr.h use of "tree"

David Edelsohn dje@watson.ibm.com
Thu May 20 11:18:00 GMT 1999


	The uses of type "tree" in gcc/expr.h need to be protected by
#ifdef TREE_CODE.

	expr.h currently includes:

/* Hook called by expand_expr for language-specific tree codes.
   It is up to the language front end to install a hook
   if it has any such codes that expand_expr needs to know about.  */
extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx,
                                       enum machine_mode,
                                       enum expand_modifier modifier));

/* Hook called by output_constant for language-specific tree codes.
   It is up to the language front-end to install a hook if it has any
   such codes that output_constant needs to know about.  Returns a
   language-independent constant equivalent to its input.  */
extern union tree_node * (*lang_expand_constant) PROTO((tree));


	In the first declaration "union tree_node *" is a typedef "tree"
when tree.h is included.  In the second declaration, type "tree" is used
in the prototype but not protected by #ifdef TREE_CODE.  I think that all
uses of that type should be declared "tree" and should be protected by
#ifdef TREE_CODE.  Building the current development sources displays a
number of warnings because of the undefined type used in the prototype.

Thanks, David


More information about the Gcc-bugs mailing list