Date: Thu, 28 Jan 1999 17:38:52 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Archie Cobbs <archie@whistle.com> Cc: nate@mt.sri.com (Nate Williams), current@FreeBSD.ORG Subject: Re: btokup().. patch to STYLE(9) (fwd) Message-ID: <199901290138.RAA16433@apollo.backplane.com> References: <199901290056.QAA07338@bubba.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
:Yes, that's true... but on balance I (personally) find it's worth :the tradeoff. : :On the other hand, I can't stand the GNU coding style.. : :-Archie : :___________________________________________________________________________ :Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com Well, not to start a flame war, but I happen to like GCC's choices for warnings with -Wall. They aren't all that bad, really... they warn you if you have an assignment in a boolean statement like: if (a = b) because it is a *very* common mistake to intend '==' rather then '='. I found a couple of those when I turned it on the kernel tree, for example. I used to use assignments in condtionals all the time myself, until one day it bit so hard it took 30 hours to find the bug - which turned out to be an assignment in a conditional that was supposed to be an ==. From that day on, I never put assignments in conditionals with an explicit boolean test, aka if ((a = b) != 0) { ... }. Beyond that it's pretty much just &/| and &&/|| precedences. I personally *never* liked the fact that C gave & and | ( and && and || ) differentl precedences. IMHO, the arithmatic-vs-shift parenthesization is something I've *always* done myself, so I don't mind those warnings either. -Wall also turns on -Wswitch which warns of switch()'d on enumerated types which lack a default. All the remaining warnings that -Wall turns on are pretty standard - for example, weak-typing warnings. I advocate prototyping and relatively strong typing myself. Weak typing warnings are a good thing. -Matt Matthew Dillon <dillon@backplane.com> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901290138.RAA16433>