help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: please explain diff bet. K&R and Linux c-mode styles


From: Alfred M. Szmidt
Subject: Re: please explain diff bet. K&R and Linux c-mode styles
Date: Tue, 29 Oct 2002 14:55:27 +0100

   I think Linux style is the same as GNU style. You could
   also just type in a few functions and see the fundamental
   differences.

Linux style and GNU style are completely different.  The coding style
that is used in Linux looks similar to K&R.  The main difference
between Linux and K&R style is that Linux uses TAB characters to
indent where as K&R uses four spaces.  

The GNU Coding Standard describes the GNU style
(http://www.gnu.org/pre/standards.html), and the file
Documentation/CodingStyle in the source code for Linux described the
Linux style.

if statements:
GNU style          Linux style         K&R style

if (foobar)        if (foobar) {       if (foobar) {
  {                        foo;            foo;
    foo;           }                   }
  }


functions:
GNU style         Linux style          K&R style

int
foobar (void)     int foobar (void)    int foobar (void)
{                 {                    {
  return 1;               return 1;        return 1;
}                 }                    }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]