From owner-freebsd-questions@FreeBSD.ORG Tue Mar 31 16:42:18 2009 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21B61065672 for ; Tue, 31 Mar 2009 16:42:18 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 21AE88FC1A for ; Tue, 31 Mar 2009 16:42:17 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id n2VGfqVB009559; Tue, 31 Mar 2009 18:42:16 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id n2VGfqDH009558; Tue, 31 Mar 2009 18:41:52 +0200 (CEST) (envelope-from olli) Date: Tue, 31 Mar 2009 18:41:52 +0200 (CEST) Message-Id: <200903311641.n2VGfqDH009558@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG, josh.carroll@gmail.com, Gary Kline In-Reply-To: <8cb6106e0903302008j5ab06a97odbd32fb68c1a404d@mail.gmail.com> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 31 Mar 2009 18:42:16 +0200 (CEST) Cc: Subject: Re: Why?? (prog question) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@FreeBSD.ORG, josh.carroll@gmail.com, Gary Kline List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 16:42:19 -0000 Josh Carroll wrote: > [...] > Note also that your main should have an int return type and should > return a value. His main() function _did_ have an int return type (it wasn't declared to be void), but of course it's better style to write int explicitly. By the way, FreeBSD's style(9) recommends to write the function return type on a separate line and begin the function name on column 1, like this: int main (int argc, char *argv[]) { ... } The clear advantage is that you can easily grep for the definition of a particular function in a bunch of source files: grep '^main' *.c Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd Perl is worse than Python because people wanted it worse. -- Larry Wall