q for the C hackers

Bob Bell bbell at hp.com
Tue Aug 19 09:34:09 EDT 2003


On Tue, Aug 19, 2003 at 09:07:23AM -0400, Kevin D. Clark <kclark at cetaceannetworks.com> wrote:
> Another possibility is to use enums, i.e.:
> 
>         enum { BUFSIZE=512 };
> 
>         char arr[BUFSIZE];
> 
> I use this frequently, and I recommend this.

    One advantage of enum's is that symbolic debuggers can display the
symbolic name, instead of just the numeric value, if the data type is
right.  We do this in the HP-UX kernel.  It even works with bit flags.
It's nice when debugging.

-- 
Bob Bell <bbell at hp.com>
-------------------------------------------------------------------------
 "Windows 98: n. minor bug-fix/patch release of 32-bit extensions
  and a graphical shell for a 16-bit patch to an 8-bit operating
  system originally coded for a 4-bit microprocessor, written by a
  2-bit company that can't stand 1 bit of competition."
   -- Author unknown



More information about the gnhlug-discuss mailing list