Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!zaphod!bobd From: bobd@zaphod.UUCP (Bob Dalgleish) Newsgroups: comp.software-eng Subject: Re: Counting semicolons (was: Re: WANTED: "C" code line counter program) Message-ID: <4196@zaphod.UUCP> Date: 25 Mar 91 21:23:11 GMT References: <9082@suns6.crosfield.co.uk> <1991Mar15.132757.6883@comm.wang.com> Organization: Develcon Electronics Limited,Saskatoon, SK, Canada Lines: 24 Define your accuracy requirements! Some C statements don't show up as such because they are primarily expressions and show up in expression lists: for ( count = 0, f = front; f->value; f = f-> next) { count++; } would show only two statements, even though six kinds of actions are occurring. Other arguments have been better presented for others as to what constitutes a statement. Prescription: choose something that is easy to count with a standard Unix tool: i.e., wc, grep, sed, etc. Then, determine how accurate it is for the sample code that you are using - within 5%, within 2.5%, whatever. Is this good enough for your usage? Don't get bogged down in what is a statement, or other metaphysical things. Just find something that is well correlated with your needs, and measure it cheaply. Anything else misses the point. -- -- * * * Remember: I before E except after DALGL * * *-- Bob Dalgleish bobd@zaphod.UUCP