Print this page
6205 onbld manuals should be declared as 1onbld
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Josef Sipek <jeffpc@josefsipek.net>
   1 cstyle(1)                        User Commands                       cstyle(1)
   2 
   3 
   4 
   5 NAME
   6        cstyle - check for some common stylistic errors in C source files
   7 
   8 SYNOPSIS
   9        cstyle [-chpvCP] [-o constructs] [file...]
  10 
  11 DESCRIPTION
  12        cstyle inspects C source files (*.c and *.h) for common sylistic
  13        errors.  It attempts to check for the cstyle documented in
  14        /shared/ON/general_docs/cstyle.ms.pdf.  Note that there is much in that
  15        document that cannot be checked for; just because your code is
  16        cstyle(1) clean does not mean that you've followed Sun's C style.
  17        Caveat emptor.
  18 
  19 OPTIONS
  20        The following options are supported:
  21 
  22        -c  Check continuation line indentation inside of functions.  Sun's C
  23            style states that all statements must be indented to an appropriate
  24            tab stop, and any continuation lines after them must be indented
  25            exactly four spaces from the start line.  This option enables a
  26            series of checks designed to find contination line problems within
  27            functions only.  The checks have some limitations;  see
  28            CONTINUATION CHECKING, below.
  29 
  30        -h  Performs heuristic checks that are sometimes wrong.  Not generally
  31            used.
  32 
  33        -p  Performs some of the more picky checks.  Includes ANSI #else and
  34            #endif rules, and tries to detect spaces after casts.  Used as part
  35            of the putback checks.
  36 


  92 
  93            Will trigger this error.  Instead, do:
  94 
  95            if (this_is_a_long_variable == another_variable)
  96            a = b + c;
  97 
  98        empty if/for/while body not on its own line
  99            For visibility, empty bodies for if, for, and while statements
 100            should be on their own line.  For example:
 101 
 102            while (do_something(&x) == 0);
 103 
 104            Will trigger this error.  Instead, do:
 105 
 106            while (do_something(&x) == 0)
 107            ;
 108 
 109 
 110 
 111 
 112                                  28 March 2005                       cstyle(1)
   1 cstyle(1ONBLD)                illumos Build Tools               cstyle(1ONBLD)
   2 
   3 
   4 
   5 NAME
   6        cstyle - check for some common stylistic errors in C source files
   7 
   8 SYNOPSIS
   9        cstyle [-chpvCP] [-o constructs] [file...]
  10 
  11 DESCRIPTION
  12        cstyle inspects C source files (*.c and *.h) for common sylistic
  13        errors.  It attempts to check for the cstyle documented in
  14        /shared/ON/general_docs/cstyle.ms.pdf.  Note that there is much in that
  15        document that cannot be checked for; just because your code is
  16        cstyle(1ONBLD) clean does not mean that you've followed Sun's C style.
  17        Caveat emptor.
  18 
  19 OPTIONS
  20        The following options are supported:
  21 
  22        -c  Check continuation line indentation inside of functions.  Sun's C
  23            style states that all statements must be indented to an appropriate
  24            tab stop, and any continuation lines after them must be indented
  25            exactly four spaces from the start line.  This option enables a
  26            series of checks designed to find contination line problems within
  27            functions only.  The checks have some limitations;  see
  28            CONTINUATION CHECKING, below.
  29 
  30        -h  Performs heuristic checks that are sometimes wrong.  Not generally
  31            used.
  32 
  33        -p  Performs some of the more picky checks.  Includes ANSI #else and
  34            #endif rules, and tries to detect spaces after casts.  Used as part
  35            of the putback checks.
  36 


  92 
  93            Will trigger this error.  Instead, do:
  94 
  95            if (this_is_a_long_variable == another_variable)
  96            a = b + c;
  97 
  98        empty if/for/while body not on its own line
  99            For visibility, empty bodies for if, for, and while statements
 100            should be on their own line.  For example:
 101 
 102            while (do_something(&x) == 0);
 103 
 104            Will trigger this error.  Instead, do:
 105 
 106            while (do_something(&x) == 0)
 107            ;
 108 
 109 
 110 
 111 
 112                                  28 March 2005                  cstyle(1ONBLD)