diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2021-01-22 14:13:58 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2021-01-22 14:13:58 +0000 |
commit | 322436470baa31b73be0b1f5de89d03fea0a7953 (patch) | |
tree | 3722b389f00a83a1ef221b9191f4df50f5ccbb87 /share | |
parent | b7891c61c561a40deccba2edf7587da8457dfb3d (diff) |
Private functions in the kernel do not to be prototyped.
We don't use static in the kernel due to ddb so functions private
to the compilation unit are basically equivalent.
OK cheloha@ gnezdo@ mglocker@
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/style.9 | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index f8a9110adb6..02a481ad3f7 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: style.9,v 1.76 2020/05/10 00:56:06 guenther Exp $ +.\" $OpenBSD: style.9,v 1.77 2021/01/22 14:13:57 millert Exp $ .\" -.Dd $Mdocdate: May 10 2020 $ +.Dd $Mdocdate: January 22 2021 $ .Dt STYLE 9 .Os .Sh NAME @@ -34,7 +34,7 @@ This file specifies the preferred style for kernel source files in the .Ox source tree. -It is also a guide for preferred userland code style. +It is also a guide for preferred userspace code style. These guidelines should be followed for all new code. In general, code can be considered .Dq new code @@ -102,13 +102,15 @@ Then there's a blank line, and the user include files. #include "pathnames.h" /* Local includes in double quotes. */ .Ed .Pp -All functions are prototyped somewhere. +All non-static functions are prototyped somewhere. .Pp Function prototypes for private functions (i.e., functions not used elsewhere) go at the top of the first source module. -In userland, functions local to one source module should be declared +In the kernel, private functions do not require a prototype as long +as they are defined before they are used. +In userspace, functions local to one source module should be declared .Ql static . -This should not be done in kernel land since it makes it impossible +This should not be done in the kernel since it makes it impossible to use the kernel debugger. .Pp Functions used from other files are prototyped in the |