|
From: Larry D. <ldo...@re...> - 2014-07-11 20:38:19
|
Steve -
On Fri, Jul 11, 2014 at 01:11:55PM -0700, Stephen Williams wrote:
> *grooooaaaaan*
> Well, if we want to be "correct", then the proper answer, I guess,
> is to create a header file for each *.vpi target, and put all
> the "extern void foo_register(void);" declarations in there.
> Then take those declarations out of the sys_table.c etc.
> files.
Indeed. That's my option #3.
> >> 3. Create 20 new .h files, each declaring foo_register(void).
> >> #include all 20 of these files in sys_table.c. Creates quite a
> >> bit of fluff for not much benefit.
I didn't like it either, which is why I suggested #4. As I wrote a
couple hours ago, using vpi/sys_time.c as an example, we'd end up with
/* Declare a prototype first, to avoid warnings with some strict C compiler
* options. This prototype conforms to the VPI plugin standard, and is
* therefore consistent with the usage in Icarus' sys_table.c. */
void sys_time_register(void);
void sys_time_register(void)
{
s_vpi_systf_data tf_data;
.
.
BTW, if you want to see this in real life, add "-Wmissing-prototypes"
to the WARNING_FLAGS_CC setup in configure.in. Then "sh autoconf.sh",
configure, and make.
- Larry
|