Header files with enums instead of defines?
From: Greg 'groggy' Lehey (grog_at_FreeBSD.org)
Date: 12/22/04
- Previous message: Robert Watson: "Re: Fixing Posix semaphores"
- Next in thread: Brian Fundakowski Feldman: "Re: Header files with enums instead of defines?"
- Reply: Brian Fundakowski Feldman: "Re: Header files with enums instead of defines?"
- Reply: Garance A Drosihn: "Re: Header files with enums instead of defines?"
- Reply: Peter Jeremy: "Re: Header files with enums instead of defines?"
- Reply: Poul-Henning Kamp: "Re: Header files with enums instead of defines?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 22 Dec 2004 11:31:43 +1030 To: FreeBSD Architecture Mailing List <arch@FreeBSD.org>
Has anybody thought about replacing #defines with enums in header
files? It would make debugging a whole lot easier. Foe example, I'm
currently looking at a debug printout which contains:
xerrno = 17,
To find out what that means, I need to go to
/usr/src/include/sys/errno.h and look for 17. I find:
#define EEXIST 17 /* File exists */
If we were to change this to
enum EEXIST = 17; /* File exists */
I'd then be able to see:
xerrno = EEXIST,
That makes debugging a whole lot easier. About the only down side I
can see is that you can't #undef an enum. Is this a big deal?
Greg
-- See complete headers for address and phone numbers.
- application/pgp-signature attachment: stored
- Previous message: Robert Watson: "Re: Fixing Posix semaphores"
- Next in thread: Brian Fundakowski Feldman: "Re: Header files with enums instead of defines?"
- Reply: Brian Fundakowski Feldman: "Re: Header files with enums instead of defines?"
- Reply: Garance A Drosihn: "Re: Header files with enums instead of defines?"
- Reply: Peter Jeremy: "Re: Header files with enums instead of defines?"
- Reply: Poul-Henning Kamp: "Re: Header files with enums instead of defines?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: Header files with enums instead of defines?
... >> Has anybody thought about replacing #defines with enums in header ...
It would make debugging a whole lot easier. ... Foe example, I'm ... (freebsd-arch) - Re: Header files with enums instead of defines?
... > Has anybody thought about replacing #defines with enums in header ...
It would make debugging a whole lot easier. ... Foe example, I'm ... (freebsd-arch) - Re: No source visible in debugger
... I don't think 9.6 changed anything with debugging. ... when I could no longer
debug. ... >> some cases I've combined code from several sample plugins. ...
>> in more header includes that are typically found in the sample plugins. ... (comp.sys.mac.programmer.codewarrior) - Re: ASP fails to import typelib using METADATA tag when debugging
... If you put the constants the enums in the page you are accessing then by rights
you should get an error that the values are redefined. ... If not then the global.asa is not being
read during the debugging. ... > On my Windows 2003 machine, using the latest version
of IIS, when I turn on server side debugging and attach a debugger the enums I have defined in a type
library are no longer recognized in ASP. ... (microsoft.public.inetserver.asp.general) - Re: How to decipher a large program.
... I'm sort of at a loss on where to start to see how it ... works.The program
has 3 c files and 4 header files. ... diagram to see how these functions interact.
... Starting from "main" can be useful, so can starting by debugging. ... (comp.programming)