|
From: Cary R. <cy...@ya...> - 2014-07-11 20:27:34
|
I think what I said originally matches what Steve just proposed. He just stated it a bit more clearly "one header file per .vpi file." Do we need to standardize the top level table file to be more consistent?
Cary
On Friday, July 11, 2014 1:12 PM, Stephen Williams <st...@ic...> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
*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.
On 07/11/2014 12:59 PM, Larry Doolittle wrote:
> Steve -
>
> On Fri, Jul 11, 2014 at 12:27:32PM -0700, Stephen Williams wrote:
>> I admit that I do not really know what the problem is. Sure, we
>> should change "void sys_time_register();" to "void
>> sys_time_register(void);", but what else could the compiler be
>> warning us about?
>
> It's trying to save us from ourselves, in the same vein as
> complaining about the perfectly valid if (foo=fopen("name","w"))
> .... and making us write if ((foo=fopen("name","w"))) .... just
> because = vs. == is such a common mistake.
>
> If you don't have a prototype for a function, it normally means
> either (a) you should declare it with a prototype in a header file
> that is shared between the function definition and the places it is
> called, so the arguments can be checked for consistency between the
> definition and the callers, or (b) it's only used in this
> "compilation unit" and therefore should be declared static, to
> avoid polluting the global name space and allow more optimization.
>
> Looking literally at this case, it's squarely in case (a) above,
> although the argument list to be checked is (void). Following the
> usual process slavishly gives 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.
>
> - Larry
>
> ------------------------------------------------------------------------------
>
>
_______________________________________________
> Iverilog-devel mailing list Ive...@li...
> https://lists.sourceforge.net/lists/listinfo/iverilog-devel
>
- --
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlPARQsACgkQrPt1Sc2b3ikvGgCgmSJBhmLGe+PV0xkPsP3HuIfz
M5MAn044hLq0wl1TxKEdNXgwaqrYXBPC
=FPpn
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
_______________________________________________
Iverilog-devel mailing list
Ive...@li...
https://lists.sourceforge.net/lists/listinfo/iverilog-devel |