Re: [SH] regs command

Tom Tromey
2012-05-24T18:05:45Z

>>>>> "Maciej" == Maciej W Rozycki <macro@codesourcery.com> writes:

Maciej> Hmm, I gave it some thinking and it looks to me like a
Maciej> functional programming problem to solve (e.g. AC_REQUIRE in
Maciej> autoconf-speak; I didn't really do any functional programming
Maciej> beyond that).

:)

Maciej> This may not be possible to express in C in a very elegant way,
Maciej> but I can imagine retaining the current init.c
Maciej> arrangement/scriptery, but in addition to that letting
Maciej> initialisers call one another.

Another way would be to just directly express it, say in comments that
are extracted by the script used to create init.c.

/* Requires: something_else */
void
_initialize_something (void) { ... }

Then dependency loops could be caught at init.c-generation time.

The problem with anything like this is maintenance of the dependencies.
That is, how do you know if one is stale? Or what do you do if you
actually hit a cycle?

For example, in the case in question -- when we eventually remove the
"regs" command, would we remember to delete the "Requires"?

Tom