problems/risks due to programming language, stories requested

David desJardins desj at idacrd.UUCP
Thu Mar 8 11:35:16 AEST 1990


>From article <2935 at goanna.oz.au>, by ok at goanna.oz.au (Richard O'keefe):
> Another trick is to use the preprocessor to help you check your counting.
> #define ten(A,B,C,D,E,F,G,H,I,J) A,B,C,D,E,F,G,H,I,H
> 
> 	some_type the_table[] = {
> 	    ten(
> 		...
> 	    )};
> 
> Now if you miscount, the preprocessor will complain.

   The posting above vividly illustrates not only one possible
"solution," but the problem with that solution as well.

   It would be better to have ways of detecting/preventing bugs which
would not introduce new, possibly even harder-to-find bugs.

   -- David desJardins



More information about the Comp.lang.c mailing list