Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 07 Apr 2015 10:01:03 +0200
From: magnum <>
Subject: Re: Coding Style

On 2015-04-07 05:02, Kai Zhao wrote:
> I think we could use the 8-character indentations but not limit
> the column size to less than 80.
> 1.  Use 8-character indentation

No! We use one-tab indentation, and the currently recommended tab-width
is 8. It's not the same thing.

> 2. Normally, the column should not exceed column 80 unless
> special cases.

Yes. And comments should almost NEVER exceed 80 (perhaps with the
exception for not breaking URLs refered to). I have bugged Jim a lot
about his superwide comments that ends up unreadable when viewed in 80

> The linux kernel claims that "The limit on the length of lines is
> 80 columns and this is a strongly preferred limit." But the longest
> column in kernel is 534 in file ‘arch/cris/arch-v32/drivers/cryptocop.c’.
> There are many lines which exceed column 80. So I think we can
> also exceed column 80 in special cases.


Also, I think we should document that we use "tab for indent, space for
align" as in This is actually what
you get with Solar's recommended indent(1) options so I presume his
recent disagreement was just a misunderstanding.

The recommendation has long been "indent -kr -i8 -nlp -nbbo -ncs -l79
-lc79" and we should add -il0 to this (plus something for the format
structs if we find it out).

OSX (BSD?) indent does not understand "-kr" but that's just a shortcut
for "-nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33
-cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf
-sai -saw -nsc -nsob -nss" (of which we override "-bbo -i4 -lp -l75").

OSX (BSD?) indent also does not understand "-nbbo" which is "prefer to
break long lines after boolean operators". And it does not understand
"-ncs" which is "do not put a space after casts". I'll simply install
GNU indent here to overcome the BSD limitations.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.