1.\"- 2.\" Copyright (c) 1995-2005 The FreeBSD Project 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL [your name] OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.\" From: @(#)style 1.14 (Berkeley) 4/28/95 27.\" $FreeBSD$ 28.\" 29.Dd December 5, 2015 30.Dt STYLE 9 31.Os 32.Sh NAME 33.Nm style 34.Nd "kernel source file style guide" 35.Sh DESCRIPTION 36This file specifies the preferred style for kernel source files in the 37.Fx 38source tree. 39It is also a guide for the preferred userland code style. 40Many of the style rules are implicit in the examples. 41Be careful to check the examples before assuming that 42.Nm 43is silent on an issue. 44.Bd -literal 45/* 46 * Style guide for FreeBSD. Based on the CSRG's KNF (Kernel Normal Form). 47 * 48 * @(#)style 1.14 (Berkeley) 4/28/95 49 * $FreeBSD$ 50 */ 51 52/* 53 * VERY important single-line comments look like this. 54 */ 55 56/* Most single-line comments look like this. */ 57 58/* 59 * Multi-line comments look like this. Make them real sentences. Fill 60 * them so they look like real paragraphs. 61 */ 62.Ed 63.Pp 64The copyright header should be a multi-line comment, with the first 65line of the comment having a dash after the star like so: 66.Bd -literal 67/*- 68 * Copyright (c) 1984-2025 John Q. Public 69 * All rights reserved. 70 * 71 * Long, boring license goes here, but trimmed for brevity 72 */ 73.Ed 74.Pp 75An automatic script collects license information from the tree for 76all comments that start in the first column with 77.Dq Li "/*-" . 78If you desire to flag 79.Xr indent 1 80to not reformat a comment that starts in the first column which is not a 81license or copyright notice, change the dash to a star for those 82comments. 83Comments starting in columns other than the first are never 84considered license statements. 85.Pp 86After any copyright header, there is a blank line, and the 87.Li $\&FreeBSD$ 88for non C/C++ language source files. 89Version control system ID tags should only exist once in a file 90(unlike in this one). 91Non-C/C++ source files follow the example above, while C/C++ source files 92follow the one below. 93All VCS (version control system) revision identification in files obtained 94from elsewhere should be maintained, including, where applicable, multiple IDs 95showing a file's history. 96In general, do not edit foreign IDs or their infrastructure. 97Unless otherwise wrapped (such as 98.Dq Li "#if defined(LIBC_SCCS)" ) , 99enclose both in 100.Dq Li "#if 0 ... #endif" 101to hide any uncompilable bits 102and to keep the IDs out of object files. 103Only add 104.Dq Li "From: " 105in front of foreign VCS IDs if the file is renamed. 106.Bd -literal 107#if 0 108#ifndef lint 109static char sccsid[] = "@(#)style 1.14 (Berkeley) 4/28/95"; 110#endif /* not lint */ 111#endif 112 113#include <sys/cdefs.h> 114__FBSDID("$FreeBSD$"); 115.Ed 116.Pp 117Leave another blank line before the header files. 118.Pp 119Kernel include files (i.e.\& 120.Pa sys/*.h ) 121come first sorted alphebetially where possible. 122Include 123.In sys/types.h 124OR 125.In sys/param.h , 126but not both and include it first. 127.In sys/types.h 128includes 129.In sys/cdefs.h , 130and it is okay to depend on that. 131.Bd -literal 132#include <sys/types.h> /* Non-local includes in angle brackets. */ 133#include <sys/endian.h> 134#include <sys/lock.h> 135#include <sys/queue.h> 136.Ed 137.Pp 138For a network program, put the network include files next. 139.Bd -literal 140#include <net/if.h> 141#include <net/if_dl.h> 142#include <net/route.h> 143#include <netinet/in.h> 144#include <protocols/rwhod.h> 145.Ed 146.Pp 147Do not use files in 148.Pa /usr/include 149for files in the kernel. 150.Pp 151Leave a blank line before the next group, the 152.Pa /usr/include 153files, 154which should be sorted alphabetically by name. 155.Bd -literal 156#include <stdio.h> 157.Ed 158.Pp 159Global pathnames are defined in 160.In paths.h . 161Pathnames local 162to the program go in 163.Qq Pa pathnames.h 164in the local directory. 165.Bd -literal 166#include <paths.h> 167.Ed 168.Pp 169Leave another blank line before the user include files. 170.Bd -literal 171#include "pathnames.h" /* Local includes in double quotes. */ 172.Ed 173.Pp 174Do not 175.Ic #define 176or declare names in the implementation namespace except 177for implementing application interfaces. 178.Pp 179The names of 180.Dq unsafe 181macros (ones that have side effects), and the names of macros for 182manifest constants, are all in uppercase. 183The expansions of expression-like macros are either a single token 184or have outer parentheses. 185Put a single tab character between the 186.Ic #define 187and the macro name. 188If a macro is an inline expansion of a function, the function name is 189all in lowercase and the macro has the same name all in uppercase. 190.\" XXX the above conflicts with ANSI style where the names are the 191.\" same and you #undef the macro (if any) to get the function. 192.\" It is not followed for MALLOC(), and not very common if inline 193.\" functions are used. 194Right-justify the 195backslashes; it makes it easier to read. 196If the macro encapsulates a compound statement, enclose it in a 197.Ic do 198loop, 199so that it can safely be used in 200.Ic if 201statements. 202Any final statement-terminating semicolon should be 203supplied by the macro invocation rather than the macro, to make parsing easier 204for pretty-printers and editors. 205.Bd -literal 206#define MACRO(x, y) do { \e 207 variable = (x) + (y); \e 208 (y) += 2; \e 209} while (0) 210.Ed 211.Pp 212When code is conditionally compiled using 213.Ic #ifdef 214or 215.Ic #if , 216a comment may be added following the matching 217.Ic #endif 218or 219.Ic #else 220to permit the reader to easily discern where conditionally compiled code 221regions end. 222This comment should be used only for (subjectively) long regions, regions 223greater than 20 lines, or where a series of nested 224.Ic #ifdef 's 225may be confusing to the reader. 226Exceptions may be made for cases where code is conditionally not compiled for 227the purposes of 228.Xr lint 1 , 229even though the uncompiled region may be small. 230The comment should be separated from the 231.Ic #endif 232or 233.Ic #else 234by a single space. 235For short conditionally compiled regions, a closing comment should not be 236used. 237.Pp 238The comment for 239.Ic #endif 240should match the expression used in the corresponding 241.Ic #if 242or 243.Ic #ifdef . 244The comment for 245.Ic #else 246and 247.Ic #elif 248should match the inverse of the expression(s) used in the preceding 249.Ic #if 250and/or 251.Ic #elif 252statements. 253In the comments, the subexpression 254.Dq Li defined(FOO) 255is abbreviated as 256.Dq Li FOO . 257For the purposes of comments, 258.Dq Ic #ifndef Li FOO 259is treated as 260.Dq Ic #if Li !defined(FOO) . 261.Bd -literal 262#ifdef KTRACE 263#include <sys/ktrace.h> 264#endif 265 266#ifdef COMPAT_43 267/* A large region here, or other conditional code. */ 268#else /* !COMPAT_43 */ 269/* Or here. */ 270#endif /* COMPAT_43 */ 271 272#ifndef COMPAT_43 273/* Yet another large region here, or other conditional code. */ 274#else /* COMPAT_43 */ 275/* Or here. */ 276#endif /* !COMPAT_43 */ 277.Ed 278.Pp 279The project is slowly moving to use the 280.St -isoC-99 281unsigned integer identifiers of the form 282.Vt uintXX_t 283in preference to the older 284.Bx Ns -style 285integer identifiers of the form 286.Vt u_intXX_t . 287New code should use the former, and old code should be converted to 288the new form if other major work is being done in that area and 289there is no overriding reason to prefer the older 290.Bx Ns -style . 291Like white-space commits, care should be taken in making 292.Vt uintXX_t 293only commits. 294.Pp 295Similarly, the project is slowly moving to use the 296.St -isoC-99 297.Vt bool 298in preference to the older 299.Vt int 300or 301.Vt boolean_t . 302New code should use 303.Vt bool , 304and old code may be converted if it is 305reasonable to do so. 306Literal values are named 307.Dv true 308and 309.Dv false . 310These are preferred to the old spellings 311.Dv TRUE 312and 313.Dv FALSE . 314Userspace code should include 315.In stdbool.h , 316while kernel code should include 317.In sys/types.h . 318.Pp 319Enumeration values are all uppercase. 320.Bd -literal 321enum enumtype { ONE, TWO } et; 322.Ed 323.Pp 324The use of internal_underscores in identifiers is preferred over 325camelCase or TitleCase. 326.Pp 327In declarations, do not put any whitespace between asterisks and 328adjacent tokens, except for tokens that are identifiers related to 329types. 330(These identifiers are the names of basic types, type 331qualifiers, and 332.Ic typedef Ns -names 333other than the one being declared.) 334Separate these identifiers from asterisks using a single space. 335.Pp 336When declaring variables in structures, declare them sorted by use, then 337by size (largest to smallest), and then in alphabetical order. 338The first category normally does not apply, but there are exceptions. 339Each one gets its own line. 340Try to make the structure 341readable by aligning the member names using either one or two tabs 342depending upon your judgment. 343You should use one tab only if it suffices to align at least 90% of 344the member names. 345Names following extremely long types 346should be separated by a single space. 347.Pp 348Major structures should be declared at the top of the file in which they 349are used, or in separate header files if they are used in multiple 350source files. 351Use of the structures should be by separate declarations 352and should be 353.Ic extern 354if they are declared in a header file. 355.Bd -literal 356struct foo { 357 struct foo *next; /* List of active foo. */ 358 struct mumble amumble; /* Comment for mumble. */ 359 int bar; /* Try to align the comments. */ 360 struct verylongtypename *baz; /* Won't fit in 2 tabs. */ 361}; 362struct foo *foohead; /* Head of global foo list. */ 363.Ed 364.Pp 365Use 366.Xr queue 3 367macros rather than rolling your own lists, whenever possible. 368Thus, 369the previous example would be better written: 370.Bd -literal 371#include <sys/queue.h> 372 373struct foo { 374 LIST_ENTRY(foo) link; /* Use queue macros for foo lists. */ 375 struct mumble amumble; /* Comment for mumble. */ 376 int bar; /* Try to align the comments. */ 377 struct verylongtypename *baz; /* Won't fit in 2 tabs. */ 378}; 379LIST_HEAD(, foo) foohead; /* Head of global foo list. */ 380.Ed 381.Pp 382Avoid using typedefs for structure types. 383Typedefs are problematic because they do not properly hide their 384underlying type; for example you need to know if the typedef is 385the structure itself or a pointer to the structure. 386In addition they must be declared exactly once, whereas an 387incomplete structure type can be mentioned as many times as 388necessary. 389Typedefs are difficult to use in stand-alone header files: 390the header that defines the typedef must be included 391before the header that uses it, or by the header that uses 392it (which causes namespace pollution), or there must be a 393back-door mechanism for obtaining the typedef. 394.Pp 395When convention requires a 396.Ic typedef , 397make its name match the struct tag. 398Avoid typedefs ending in 399.Dq Li _t , 400except as specified in Standard C or by 401.Tn POSIX . 402.Bd -literal 403/* Make the structure name match the typedef. */ 404typedef struct bar { 405 int level; 406} BAR; 407typedef int foo; /* This is foo. */ 408typedef const long baz; /* This is baz. */ 409.Ed 410.Pp 411All functions are prototyped somewhere. 412.Pp 413Function prototypes for private functions (i.e., functions not used 414elsewhere) go at the top of the first source module. 415Functions 416local to one source module should be declared 417.Ic static . 418.Pp 419Functions used from other parts of the kernel are prototyped in the 420relevant include file. 421Function prototypes should be listed in a logical order, preferably 422alphabetical unless there is a compelling reason to use a different 423ordering. 424.Pp 425Functions that are used locally in more than one module go into a 426separate header file, e.g.\& 427.Qq Pa extern.h . 428.Pp 429Do not use the 430.Dv __P 431macro. 432.Pp 433In general code can be considered 434.Dq "new code" 435when it makes up about 50% or more of the file(s) involved. 436This is enough 437to break precedents in the existing code and use the current 438.Nm 439guidelines. 440.Pp 441The kernel has a name associated with parameter types, e.g., in the kernel 442use: 443.Bd -literal 444void function(int fd); 445.Ed 446.Pp 447In header files visible to userland applications, prototypes that are 448visible must use either 449.Dq protected 450names (ones beginning with an underscore) 451or no names with the types. 452It is preferable to use protected names. 453E.g., use: 454.Bd -literal 455void function(int); 456.Ed 457.Pp 458or: 459.Bd -literal 460void function(int _fd); 461.Ed 462.Pp 463Prototypes may have an extra space after a tab to enable function names 464to line up: 465.Bd -literal 466static char *function(int _arg, const char *_arg2, struct foo *_arg3, 467 struct bar *_arg4); 468static void usage(void); 469 470/* 471 * All major routines should have a comment briefly describing what 472 * they do. The comment before the "main" routine should describe 473 * what the program does. 474 */ 475int 476main(int argc, char *argv[]) 477{ 478 char *ep; 479 long num; 480 int ch; 481.Ed 482.Pp 483For consistency, 484.Xr getopt 3 485should be used to parse options. 486Options 487should be sorted in the 488.Xr getopt 3 489call and the 490.Ic switch 491statement, unless 492parts of the 493.Ic switch 494cascade. 495Elements in a 496.Ic switch 497statement that cascade should have a 498.Li FALLTHROUGH 499comment. 500Numerical arguments should be checked for accuracy. 501Code which is unreachable for non-obvious reasons may be marked /* 502.Li NOTREACHED 503*/. 504.Bd -literal 505 while ((ch = getopt(argc, argv, "abNn:")) != -1) 506 switch (ch) { /* Indent the switch. */ 507 case 'a': /* Don't indent the case. */ 508 aflag = 1; /* Indent case body one tab. */ 509 /* FALLTHROUGH */ 510 case 'b': 511 bflag = 1; 512 break; 513 case 'N': 514 Nflag = 1; 515 break; 516 case 'n': 517 num = strtol(optarg, &ep, 10); 518 if (num <= 0 || *ep != '\e0') { 519 warnx("illegal number, -n argument -- %s", 520 optarg); 521 usage(); 522 } 523 break; 524 case '?': 525 default: 526 usage(); 527 } 528 argc -= optind; 529 argv += optind; 530.Ed 531.Pp 532Space after keywords 533.Pq Ic if , while , for , return , switch . 534Two styles of braces 535.Ql ( \&{ 536and 537.Ql \&} ) 538are allowed for single line statements. 539Either they are used for all single statements, or 540they are used only where needed for clarity. 541Usage within a function should be consistent. 542Forever loops are done with 543.Ic for Ns 's , 544not 545.Ic while Ns 's . 546.Bd -literal 547 for (p = buf; *p != '\e0'; ++p) 548 ; /* nothing */ 549 for (;;) 550 stmt; 551 for (;;) { 552 z = a + really + long + statement + that + needs + 553 two + lines + gets + indented + four + spaces + 554 on + the + second + and + subsequent + lines; 555 } 556 for (;;) { 557 if (cond) 558 stmt; 559 } 560 if (val != NULL) 561 val = realloc(val, newsize); 562.Ed 563.Pp 564Parts of a 565.Ic for 566loop may be left empty. 567Do not put declarations 568inside blocks unless the routine is unusually complicated. 569.Bd -literal 570 for (; cnt < 15; cnt++) { 571 stmt1; 572 stmt2; 573 } 574.Ed 575.Pp 576Indentation is an 8 character tab. 577Second level indents are four spaces. 578If you have to wrap a long statement, put the operator at the end of the 579line. 580.Bd -literal 581 while (cnt < 20 && this_variable_name_is_too_long && 582 ep != NULL) 583 z = a + really + long + statement + that + needs + 584 two + lines + gets + indented + four + spaces + 585 on + the + second + and + subsequent + lines; 586.Ed 587.Pp 588Do not add whitespace at the end of a line, and only use tabs 589followed by spaces 590to form the indentation. 591Do not use more spaces than a tab will produce 592and do not use spaces in front of tabs. 593.Pp 594Closing and opening braces go on the same line as the 595.Ic else . 596Braces that are not necessary may be left out. 597.Bd -literal 598 if (test) 599 stmt; 600 else if (bar) { 601 stmt; 602 stmt; 603 } else 604 stmt; 605.Ed 606.Pp 607No spaces after function names. 608Commas have a space after them. 609No spaces 610after 611.Ql \&( 612or 613.Ql \&[ 614or preceding 615.Ql \&] 616or 617.Ql \&) 618characters. 619.Bd -literal 620 error = function(a1, a2); 621 if (error != 0) 622 exit(error); 623.Ed 624.Pp 625Unary operators do not require spaces, binary operators do. 626Do not use parentheses unless they are required for precedence or unless the 627statement is confusing without them. 628Remember that other people may 629confuse easier than you. 630Do YOU understand the following? 631.Bd -literal 632 a = b->c[0] + ~d == (e || f) || g && h ? i : j >> 1; 633 k = !(l & FLAGS); 634.Ed 635.Pp 636Exits should be 0 on success, or 1 on failure. 637.Bd -literal 638 exit(0); /* 639 * Avoid obvious comments such as 640 * "Exit 0 on success." 641 */ 642} 643.Ed 644.Pp 645The function type should be on a line by itself 646preceding the function. 647The opening brace of the function body should be 648on a line by itself. 649.Bd -literal 650static char * 651function(int a1, int a2, float fl, int a4) 652{ 653.Ed 654.Pp 655When declaring variables in functions declare them sorted by size, 656then in alphabetical order; multiple ones per line are okay. 657If a line overflows reuse the type keyword. 658.Pp 659Be careful to not obfuscate the code by initializing variables in 660the declarations. 661Use this feature only thoughtfully. 662DO NOT use function calls in initializers. 663.Bd -literal 664 struct foo one, *two; 665 double three; 666 int *four, five; 667 char *six, seven, eight, nine, ten, eleven, twelve; 668 669 four = myfunction(); 670.Ed 671.Pp 672Do not declare functions inside other functions; ANSI C says that 673such declarations have file scope regardless of the nesting of the 674declaration. 675Hiding file declarations in what appears to be a local 676scope is undesirable and will elicit complaints from a good compiler. 677.Pp 678Casts and 679.Ic sizeof Ns 's 680are not followed by a space. 681Note that 682.Xr indent 1 683does not understand this rule. 684.Ic sizeof Ns 's 685are written with parenthesis always. 686The redundant parenthesis rules do not apply to 687.Fn sizeof var 688instances. 689.Pp 690.Dv NULL 691is the preferred null pointer constant. 692Use 693.Dv NULL 694instead of 695.Vt ( "type *" ) Ns 0 696or 697.Vt ( "type *" ) Ns Dv NULL 698in contexts where the compiler knows the 699type, e.g., in assignments. 700Use 701.Vt ( "type *" ) Ns Dv NULL 702in other contexts, 703in particular for all function args. 704(Casting is essential for 705variadic args and is necessary for other args if the function prototype 706might not be in scope.) 707Test pointers against 708.Dv NULL , 709e.g., use: 710.Bd -literal 711(p = f()) == NULL 712.Ed 713.Pp 714not: 715.Bd -literal 716!(p = f()) 717.Ed 718.Pp 719Do not use 720.Ic \&! 721for tests unless it is a boolean, e.g.\& use: 722.Bd -literal 723if (*p == '\e0') 724.Ed 725.Pp 726not: 727.Bd -literal 728if (!*p) 729.Ed 730.Pp 731Routines returning 732.Vt "void *" 733should not have their return values cast 734to any pointer type. 735.Pp 736Values in 737.Ic return 738statements should be enclosed in parentheses. 739.Pp 740Use 741.Xr err 3 742or 743.Xr warn 3 , 744do not roll your own. 745.Bd -literal 746 if ((four = malloc(sizeof(struct foo))) == NULL) 747 err(1, (char *)NULL); 748 if ((six = (int *)overflow()) == NULL) 749 errx(1, "number overflowed"); 750 return (eight); 751} 752.Ed 753.Pp 754Old-style function declarations look like this: 755.Bd -literal 756static char * 757function(a1, a2, fl, a4) 758 int a1, a2; /* Declare ints, too, don't default them. */ 759 float fl; /* Beware double vs. float prototype differences. */ 760 int a4; /* List in order declared. */ 761{ 762.Ed 763.Pp 764Use ANSI function declarations unless you explicitly need K&R compatibility. 765Long parameter lists are wrapped with a normal four space indent. 766.Pp 767Variable numbers of arguments should look like this: 768.Bd -literal 769#include <stdarg.h> 770 771void 772vaf(const char *fmt, ...) 773{ 774 va_list ap; 775 776 va_start(ap, fmt); 777 STUFF; 778 va_end(ap); 779 /* No return needed for void functions. */ 780} 781 782static void 783usage() 784{ 785 /* Insert an empty line if the function has no local variables. */ 786.Ed 787.Pp 788Use 789.Xr printf 3 , 790not 791.Xr fputs 3 , 792.Xr puts 3 , 793.Xr putchar 3 , 794whatever; it is faster and usually cleaner, not 795to mention avoiding stupid bugs. 796.Pp 797Usage statements should look like the manual pages 798.Sx SYNOPSIS . 799The usage statement should be structured in the following order: 800.Bl -enum 801.It 802Options without operands come first, 803in alphabetical order, 804inside a single set of brackets 805.Ql ( \&[ 806and 807.Ql \&] ) . 808.It 809Options with operands come next, 810also in alphabetical order, 811with each option and its argument inside its own pair of brackets. 812.It 813Required arguments 814(if any) 815are next, 816listed in the order they should be specified on the command line. 817.It 818Finally, 819any optional arguments should be listed, 820listed in the order they should be specified, 821and all inside brackets. 822.El 823.Pp 824A bar 825.Pq Ql \&| 826separates 827.Dq either-or 828options/arguments, 829and multiple options/arguments which are specified together are 830placed in a single set of brackets. 831.Bd -literal -offset 4n 832"usage: f [-aDde] [-b b_arg] [-m m_arg] req1 req2 [opt1 [opt2]]\en" 833"usage: f [-a | -b] [-c [-dEe] [-n number]]\en" 834.Ed 835.Bd -literal 836 (void)fprintf(stderr, "usage: f [-ab]\en"); 837 exit(1); 838} 839.Ed 840.Pp 841Note that the manual page options description should list the options in 842pure alphabetical order. 843That is, without regard to whether an option takes arguments or not. 844The alphabetical ordering should take into account the case ordering 845shown above. 846.Pp 847New core kernel code should be reasonably compliant with the 848.Nm 849guides. 850The guidelines for third-party maintained modules and device drivers are more 851relaxed but at a minimum should be internally consistent with their style. 852.Pp 853Stylistic changes (including whitespace changes) are hard on the source 854repository and are to be avoided without good reason. 855Code that is approximately 856.Fx 857KNF 858.Nm 859compliant in the repository must not diverge from compliance. 860.Pp 861Whenever possible, code should be run through a code checker 862(e.g., 863.Xr lint 1 864or 865.Nm cc Fl Wall ) 866and produce minimal warnings. 867.Sh SEE ALSO 868.Xr indent 1 , 869.Xr lint 1 , 870.Xr err 3 , 871.Xr warn 3 , 872.Xr style.Makefile 5 873.Sh HISTORY 874This manual page is largely based on the 875.Pa src/admin/style/style 876file from the 877.Bx 4.4 Lite2 878release, with occasional updates to reflect the current practice and 879desire of the 880.Fx 881project. 882.Pa src/admin/style/style 883is a codification by the CSRG of the programming style of Ken Thompson and 884Dennis Ritchie in 885.At v6 . 886