Now guess what happens: You forget to add your New_Init() and New_Run() to main(), and suddenly, the system behaves very strange. In fact, it is number one on our debugging check list. Number two is wrong order of the init functions. Also, all that hand-written stuff takes a lot of time when you set up a new project.
One idea is to have a single config file in some easy to understand format and have Perl write the .c and .h code for this initialization and loop run code from that.
You have to modify your make file to accommodate that Perl step. In general there is no problem with having a program write another program (Larry Wall says that these are the happiest programs of all).
In reply to Re: [OT] Abusing GNU compiler and linker: Make the linker generate an array of function pointers
by Marshall
in thread [OT] Abusing GNU compiler and linker: Make the linker generate an array of function pointers
by afoken
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |