cvs commit: src/sbin/init init.c

Ed Schouten ed at 80386.nl
Mon Sep 29 10:12:24 UTC 2008


* Christoph Mallon <christoph.mallon at gmx.de> wrote:
> If a function or variable can be made static, it should be. There is
> basically not excuse not to do so. In fact, it is considered a design
> flaw of C, that symbols default to external linkage instead of internal
> by default.

If I remember correctly we use -Wmissing-prototypes to somewhat catch
this bad programming behaviour. Unfortunately GCC does not support a
flag to do a similar thing for variables (where we enforce a variable to
be `prototyped' with the `extern' keyword before allowing it to be
declared. I noticed we have many variables in the kernel that should be
marked static, but aren't.

I don't know enough of GCC's internals to add this functionality.

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20080929/8187a479/attachment.pgp


More information about the cvs-src mailing list