From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2283 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: New docs outline Date: Thu, 15 Nov 2012 18:36:46 -0500 Message-ID: <20121115233646.GJ20323@brightrain.aerifal.cx> References: <20121115222004.GA29041@brightrain.aerifal.cx> <99507C20-19E2-4A14-BD5F-3ECC61A79BF8@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1353022618 13199 80.91.229.3 (15 Nov 2012 23:36:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2012 23:36:58 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2284-gllmg-musl=m.gmane.org@lists.openwall.com Fri Nov 16 00:37:08 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TZ8zb-0003mD-WD for gllmg-musl@plane.gmane.org; Fri, 16 Nov 2012 00:37:08 +0100 Original-Received: (qmail 31814 invoked by uid 550); 15 Nov 2012 23:36:58 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 31806 invoked from network); 15 Nov 2012 23:36:57 -0000 Content-Disposition: inline In-Reply-To: <99507C20-19E2-4A14-BD5F-3ECC61A79BF8@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2283 Archived-At: On Thu, Nov 15, 2012 at 02:38:37PM -0800, nwmcsween@gmail.com wrote: > I would really like a set coding style, currently musl utilizes > whatever whomever decided to write at the time, usually for pedantic > things such as parens around sizeof, spacing around operators, etc. For sizeof, the style is not to use parens on objects, only on types or expressions where the parens are needed for grouping. This makes it clear that the size of an object, rather than a type, is being taken. I believe this is consistent across the source except for some code like TRE or crypt stuff that was originally written elsewhere and imported into musl; it was at least intended to be consistent. For spacing and parens on operators, it's usually done just from a standpoint of readability -- avoiding too many levels of parens, and using spacing to help make the grouping obvious. Also to avoid going past 80 columns or breaking lines (which also hurts readability). Personally, I feel like this sort of goal/effect-oriented style guideline is more useful than a strict formatting rule. The latter can easily be obtained by a machine if desired, but often hurts readability as much as it helps. > I also wouldn't mind Linux style function documentation. I'm not familiar with the convention, but it might be worth adopting. However, musl doesn't have many functions which are internal-use-only. Most things are standard interfaces documented in the C or POSIX standards. Rich