From owner-freebsd-current Fri Jan 29 05:15:19 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA15133 for freebsd-current-outgoing; Fri, 29 Jan 1999 05:15:19 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA15091 for ; Fri, 29 Jan 1999 05:15:14 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from keep.lan.Awfulhak.org (keep.lan.Awfulhak.org [172.16.0.8]) by awfulhak.org (8.8.8/8.8.8) with ESMTP id NAA24123; Fri, 29 Jan 1999 13:14:56 GMT (envelope-from brian@Awfulhak.org) Received: from keep.lan.Awfulhak.org (localhost [127.0.0.1]) by keep.lan.Awfulhak.org (8.9.2/8.9.2) with ESMTP id IAA00519; Fri, 29 Jan 1999 08:34:00 GMT (envelope-from brian@keep.lan.Awfulhak.org) Message-Id: <199901290834.IAA00519@keep.lan.Awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Andrew Kenneth Milton cc: julian@whistle.com (Julian Elischer), mike@smith.net.au, dillon@apollo.backplane.com, archie@whistle.com, nate@mt.sri.com, current@FreeBSD.ORG Subject: Re: btokup().. patch to STYLE(9) (fwd) In-reply-to: Your message of "Fri, 29 Jan 1999 13:09:55 +1000." <199901290309.NAA25300@zeus.theinternet.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 29 Jan 1999 08:34:00 +0000 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > +----[ Julian Elischer ]--------------------------------------------- > | yeah but not a SINGLE person has said to not commit the patch to style(9) > | so I'm going to do it later tonight.. > | (It doesn't make extra braces MANDATORY but it does ALLOW them.) > | > | julian > | (if this doesn't bring some NEYs I'll be amazed..) > > Only from people who don't seem to cut code in the real world. [.....] > There are only disadvantages to leaving them out. I missed the original suggestion, but I have an objection to *insisting* on extra braces (*allowing* is absolutely fine) - such as gcc-2.8.1's idea that if (x) if (y) blah1 else blah2 should have braces around the inner if/else. As Nate has already pointed out, it's not the compilers job to check that your style is GNU flavoured. I think this sort of warning should be removed from the system compiler rather than changing all software to add the extraneous braces. My argument is that this sort of thing gets out of hand. I've seen things such as if (((a == b) || (c == d))) where a, b, c & d are just simple variables - there are so many redundant brackets that you have to double-check that there isn't some weird grouping.... Also, with non-k&r style code, you can end up with so many redundant braces that you can't see enough context on your screen to know what the code is doing: if (a) { expr1 } else if (b) { expr2 } else .... But where do you draw the line in style(9) ? Dunno. > -- > Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew > The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | Milton > ACN: 082 081 472 | M:+61 416 022 411 |72 Col .Sig > PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|Specialist -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message