Insert global varible declaration with a plugin

Pedro Paredes 0narcoboy0@gmail.com
Wed Sep 24 19:57:00 GMT 2014


I would know if it's possible to insert a global variable declaration
with a gcc plugin. For example if I got de following code:

---------------------------------------test.c------------------------------------

int main(void) {
  return 0;
}

------------------------------------------------------------------------------------

and I want to transform it with a plugin into:

------------------------------------------------------------------------------------

int fake_var;

int main(void) {
  return 0;
}

------------------------------------------------------------------------------------

Is that possible? If it's possible, in wich pass a how can I do it?



More information about the Gcc-patches mailing list