In addition to keeping track of types, the type machinery also locates the global variables that the garbage collector starts at. There are two syntaxes it accepts to indicate a root:
extern GTY (([options])) [type] ID;
static GTY (([options])) [type] ID;
These are the only syntaxes that are accepted. In particular, if you want to mark a variable that is only declared as
int ID;or similar, you should either make it
static
or you should create
a extern
declaration in a header file somewhere.