This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tree_code enum usage in hooks.c


Hello,

I need to use enum tree_code for default hook in hooks.c. I had to add
"tree.h" include into "hook.c" for that. But it caused some errors in
gcc build:

gcc   -g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition
-Wc++-compat -fno-common  -DHAVE_CONFIG_H  -o xgcc gcc.o ggc-none.o \
  gccspec.o driver-i386.o  libcommon-target.a libcommon.a
../libcpp/libcpp.a   ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a
libcommon-target.a(hooks.o): In function `build1_stat_loc':
/export/users/ienkovic/gcc-tree-reassoc/gcc/../../gcc/gcc/tree.h:4180:
undefined reference to `build1_stat'
/export/users/ienkovic/gcc-tree-reassoc/gcc/../../gcc/gcc/tree.h:4181:
undefined reference to `tree_code_type'
/export/users/ienkovic/gcc-tree-reassoc/gcc/../../gcc/gcc/tree.h:4181:
undefined reference to `tree_code_type'
/export/users/ienkovic/gcc-tree-reassoc/gcc/../../gcc/gcc/tree.h:4182:
undefined reference to `tree_code_type'
/export/users/ienkovic/gcc-tree-reassoc/gcc/../../gcc/gcc/tree.h:4182:
undefined reference to `tree_class_check_failed'
...

So, "tree.h" inclusion requires linkage of additional objects and I do
not think it is a good idea to do it because I need enum only. I can
move this enum definition somewhere like "coretypes.h" but I'm not
sure this is the best solution. Could please anyone suggest the right
way to fix this problem?

Thanks
Ilya


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]