Re: __initfunc - very clever and nice, but...

Michael Poole (poole@graviton.res.cmu.edu)
09 Jul 1998 08:54:37 -0400


Tigran Aivazian <tigran@sco.COM> writes:

> I am sure __initfunc was a very good idea in terms of throwing away the
> unused init code but it creates a small nuisance with respect to using
> ctags/vim. I already mailed the author of vim(1) but his responce was very
> logical explanation that since this is not C there is no reason why ctags
> should recognise the stuff starting with __initfunc as a function.
>
> For example, if I try vi -t start_kernel I get two tags - both in alpha
> arch which I have no interest in, simply because the i386 one is
> __initfunc.
>
> Is there some other clever way to indicate that a function is to be
> __initfunc'ed and yet keep it visible to ctags(1)?

I'm not sure that the criticism that it 'is not C' holds up. Sure,
the source doesn't conform to a strict language grammar, but every C
compiler runs the source through a preprocessor before trying to compile
it. IMO, ctags should do the same; cpp (at least from gcc and egcs) emits
#line labels that act as directives to the consumer as to where the
following source came from, so the expansion induced by preprocessing the
source shouldn't have an effect on tag accuracy. The Linux kernel is far
from the only software that does this, so we probably shouldn't have hacks
to trick ctags or etags into doing the 'right' thing when they really don't.

-- Michael

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu