[Asterisk-Dev] sensible buffer size management

Andrew Edem andrew at kaxis.cx
Wed May 4 03:54:37 MST 2005


> > find . -name \*.\[ch\] -exec grep -H char \{\} \; | egrep '\[[0-9]+' | wc -l
>     1672
> > find . -name \*.\[ch\] -exec grep -H char \{\} \; | egrep '\[[A-Z]+' | wc -l
>      590


I really disagree with this methodology for finding definitions. First
of, this doesn't identify definitions, it identifies any instance where
an integer is inside of square brackets, so, it counts:

unsigned char data[24];
byte = data[1+i];
byte = data[7];

As the same, but won't count:

unsigned char data[ 24 ];

The point is taken, however. Perhaps it would be good for you to write a
minimal utility to find array definitions whose size is devined by
integer constants instead of named constants.

-Andrew



More information about the asterisk-dev mailing list