|
From: Cary R. <cy...@ya...> - 2014-07-11 17:42:10
|
I find #4 acceptable in it's present form, but it would be best to put a comment describing why the definition is there to avoid confusion in the future.
Cary
On Friday, July 11, 2014 10:34 AM, Larry Doolittle <ldo...@re...> wrote:
Cary -
On Fri, Jul 11, 2014 at 10:16:22AM -0700, Cary R. wrote:
> If I understand this correctly #3 seems like too much work, #4 looks wrong since these are not static functions they are extern. I understand not wanting the warnings so that implies that #2 is the best choice. Can sys_priv.h be used to define these functions? I'm guessing most of the files already include it. Or maybe we need files for each table type (normal, math, v2009, etc.).
Sorry to have put a critical typo in #4.
4. Just paper over the warning in each of the modules by
void foo_register(void);
void foo_register(void)
{
blah blah blah
}
My original comments still apply, and this is no longer "wrong" as
your reply pointed out.
I managed to cut-and-paste from the one example (vhdl_register) that
is not part of the sys_table.c subsystem, and therefore the one
out of ~30 that has a static on it. Just unlucky today, I guess.
I agree with your assessment on #3, but I really don't like #2 either.
#4 just adds one new line to each of 20 vpi source files.
- Larry
> On Friday, July 11, 2014 9:33 AM, Larry Doolittle <ldo...@re...> wrote:
> Friends -
>
> Looking in vpi at all the foo_register() routines, which account for
> almost all of the remaining missing-prototypes warnings flagged.
> What to do? I see four approaches, each has problems.
>
> 1. Leave them the way they are, and expect people like me who chase
> lint to filter out the warnings as spurious. Where and how would we
> document that?
>
> 2. Move the block of 20 "extern void foo_register(void);" declarations
> in sys_table.c into a .h file, which is then #included into each of the
> C functions. Introduces a spurious cross-dependency between each of the
> modules.
>
> 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.
>
> 4. Just paper over the warning in each of the modules by
> static void foo_register(void);
> static void foo_register(void)
> {
> blah blah blah
> }
> Minimal change, gets rid of the warnings. Doesn't really check for
> argument mismatches, but in this case there are no arguments to check. |