Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Sep 2008 12:12:21 +0200
From:      Ed Schouten <ed@80386.nl>
To:        Christoph Mallon <christoph.mallon@gmx.de>
Cc:        src-committers@freebsd.org, d@delphij.net, cvs-src@freebsd.org, cvs-all@freebsd.org, Xin LI <delphij@freebsd.org>, Kostik Belousov <kostikbel@gmail.com>
Subject:   Re: cvs commit: src/sbin/init init.c
Message-ID:  <20080929101221.GC16837@hoeg.nl>
In-Reply-To: <48DFF1AE.6060408@gmx.de>
References:  <200809270009.m8R09OTF000738@repoman.freebsd.org> <20080927084606.GZ47828@deviant.kiev.zoral.com.ua> <48DFE13E.2030200@delphij.net> <20080928203210.GA2433@deviant.kiev.zoral.com.ua> <48DFF1AE.6060408@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--69pVuxX8awAiJ7fD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Christoph Mallon <christoph.mallon@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.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--69pVuxX8awAiJ7fD
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkjgqgUACgkQ52SDGA2eCwXxlwCfQFs1/QMMrZ4ozkvpr7zjueF/
yBkAn1TuDd2zVwRWXyVYLj8e4uMJvcWy
=qZ6m
-----END PGP SIGNATURE-----

--69pVuxX8awAiJ7fD--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080929101221.GC16837>