C Style Wishes

Dave Yost day at kovacs.UUCP
Mon Sep 30 15:57:07 AEST 1985


A few suggestions:

I am porting a large system (which shall remain
nameless) to the Gould.  I have found one bug already,
which was caused by the lack of signed characters on the
Gould.  So, what do you suppose I do next?  Of course, I
decide to go through all the code looking for all the
char declarations to see where else this problem may
bite.  Of course, I use the handy `grep' utility.  But
the declaration style used makes my grep output
incomplete.  I find lots of declarations like:

	register char *cp,
		      c;

Please, folks, use

	register char *cp;
	register char chr;

instead.  It helps when you need to do a grep, and if
the declarations have register storage class, as here,
it helps you count register declarations (or better yet,
you can prioritize them with Reg1, Reg2, etc. as defined
for the host machine in a standard include file).

And while I'm at it, most of us look at C source as
manifested on a screen through an editor, rather than
with ink on paper, and often, we want to look at all the
places where a variable is referenced.  Ever notice that
searches for single-letter variable names tend to find
lots of stuff you aren't looking for?

Thanks.  Now I'll go and put on my asbestos suit for
a couple of weeks.

--dave



More information about the Comp.lang.c mailing list