cproto use in the kernel source tree?

Urban Widmark (urban@teststation.com)
Thu, 21 Jun 2001 10:04:37 +0200 (CEST)


I would like to automate generating the prototype list for smbfs. The list
in include/linux/smb_fs.h is probably mostly correct ... or not.

Does anyone use this type of tool anywhere else in the kernel sources?
Any input on how to set it up right is appreciated.

Here is what I have right now. arch/i386/math-emu/Makefile has this rule

proto:
cproto -e -DMAKING_PROTO *.c >fpu_proto.h

If I do that in the smbfs Makefile, and run it as:
$ make TOPDIR=`pwd` -C fs/smbfs proto

I get heaps of errors (some of which I also get for the math-emu rule and
fpu_proto.h is definitly hand edited, so I wonder if it is really used).

For one thing it goes digging in "/usr/include/asm/" which isn't exactly
what I want. I can improve it by changing the rule to:

proto:
cproto -e -I$(TOPDIR)/include -D__KERNEL__ -DMAKING_PROTO *.c > proto.h

And that seems to sort of work.

The only thing is that I get wierd errors on some gcc header:

"/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h", line 43: parse
error at token '__builtin_va_list'
Expected: auto char define-name double extern inline register static ...
union

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)
$ rpm -qf `which gcc`
gcc-2.96-69
$ rpm -qf `which cproto`
cproto-4.6-5

I know it stops working (it misses some functions and complains more :)
after I apply some of my non-released patches. But that is probably
something I do wrong.

Is cproto even a good tool for doing this in the kernel tree?

/Urban

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/