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]

LANG HOOKS


Hi there,
I am trying to make new frontend to GNU CC 3.3.2 (just simple frontend for demo purposes). I have some problems with LANG_HOOKS. As I have read in sources of other frontend, I need to define several LANG_HOOKS and then:

const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;

is needed. Doing so I get uggly error message from compiler:

---> cut here <---
demo/demo.c:136: error: invalid application of `sizeof' to an incomplete type
demo/demo.c:136: warning: initialization from incompatible pointer type
demo/demo.c:136: warning: initialization from incompatible pointer type
demo/demo.c:136: warning: initialization from incompatible pointer type
demo/demo.c:136: warning: initialization from incompatible pointer type
demo/demo.c:136: error: `global_bindings_p' undeclared here (not in a function)
demo/demo.c:136: error: initializer element is not constant
demo/demo.c:136: error: (near initialization for `lang_hooks.decls.global_bindings_p')
demo/demo.c:136: error: `insert_block' undeclared here (not in a function)
demo/demo.c:136: error: initializer element is not constant
demo/demo.c:136: error: (near initialization for `lang_hooks.decls.insert_block')
demo/demo.c:136: error: `set_block' undeclared here (not in a function)
demo/demo.c:136: error: initializer element is not constant
demo/demo.c:136: error: (near initialization for `lang_hooks.decls.set_block')
demo/demo.c:136: error: `getdecls' undeclared here (not in a function)
demo/demo.c:136: error: initializer element is not constant
demo/demo.c:136: error: (near initialization for `lang_hooks.decls.getdecls')
demo/demo.c:136: warning: missing initializer
demo/demo.c:136: warning: (near initialization for `lang_hooks.decls.global_bindings_p')
demo/demo.c:136: error: initializer element is not constant
demo/demo.c:136: error: (near initialization for `lang_hooks.decls')
demo/demo.c:136: error: initializer element is not constant
demo/demo.c:136: error: (near initialization for `lang_hooks.types')
demo/demo.c:136: warning: missing initializer
demo/demo.c:136: warning: (near initialization for `lang_hooks.decls')
make[2]: *** [demo.o] Error 1
make[1]: *** [stage2_build] Error 2
make: *** [bootstrap] Error 2
---> cut here <---

What is wrong? langhooks.h and langhooks-def.h are both #included. Line 136 is already mentioned:
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;

FYI I use gcc 3.2.3 to compile it (on debian).
Thank in advance.
sc.


____________________________________________________________
PC DEXX za 16.990 s DPH! Athlon XP 2200+, CDRW, 80G, 17" monitor. Poslední
levný nákup před Vánoci! http://ad2.seznam.cz/redir.cgi?instance=65991%26url=http://www.dexx.cz/frame_Narsil_16a.htm


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