Path: utzoo!utgpu!water!watmath!clyde!cbosgd!osu-cis!tut!bgsuvax!denbeste From: denbeste@bgsuvax.UUCP (William C. DenBesten) Newsgroups: comp.lang.c Subject: if (); (was:= vs ==) Message-ID: <1531@bgsuvax.UUCP> Date: 28 Jan 88 16:23:35 GMT References: <2033@frog.UUCP> Organization: Bowling Green State University B.G., Oh. Lines: 29 > if (a); > stat1; > for (i = 1; i < 100; i++); > fn3 (argument, i); > Indentation is IGNORED by Lint and the compiler, but is superficially VERY > significant to we visually oriented beings. Thus the occasional problem > in spotting the above class of errors. This statement hits a nail squarely on its head. I used to have terrible problems with C syntax as I was learning C. I then discovered c-mode in GNU emacs. Its basic trick is that it indents the current line properly, depending on the lines before it. I commonly make the above errors, forget to close a quote or parenthesis, and a myrid of other errors. When I hit tab and the line isn't adjusted to where I expect it to be, I know to take a look at the previous couple of lines, and voila a typo is uncovered. Another way to find this sort of error is to run your code through a c beautifier (cb) and look at the way that it indents the code. Of course, you have to be suspecting this sort of error to even think about attemptin this. --- William C. DenBesten | CSNET denbeste@research1.bgsu.edu Dept of Computer Science | UUCP ...!cbosgd!osu-cis!bgsuvax!denbeste Bowling Green State University | Bowling Green, OH 43403-0214 |