A tool which can intelligently augment C source

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Tue Sep 25 15:49:30 AEST 1990


In article <11054 at sybase.sybase.com>, scottl at mercury.sybase.com (Scott Luebking) writes:
> Another thing would be to preceed[sic] return statements with functions, e.g.:

>      return some_expression	FLAG_RETURN("foo",(long) (some_expression));
> 				return some_expression

Um, do you _really_ want to evaluate "some_expression" twice?
And how do you expect this to work when I have
	struct complex Cadd(x, y) struct complex x, y; {
	    struct complex s; ... return s;
	}

If it's just for your own use, you could pick up the sources of Alan Holub's
C compiler for US$60 and modify it to act as the processor you want.
You really do want your tool to understand C types so that it doesn't try
to cast structs to longs.  And if you want to catch all returns, you don't
want to miss the implicit one at the end of a void function.
-- 
Heuer's Law:  Any feature is a bug unless it can be turned off.



More information about the Comp.lang.c mailing list