Re: Header files with enums instead of defines?
From: Brian Fundakowski Feldman (green_at_FreeBSD.org)
Date: 12/22/04
- Previous message: Joe Kelsey: "Re: Fixing Posix semaphores"
- In reply to: Greg 'groggy' Lehey: "Header files with enums instead of defines?"
- Next in thread: Greg 'groggy' Lehey: "Re: Header files with enums instead of defines?"
- Reply: Greg 'groggy' Lehey: "Re: Header files with enums instead of defines?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 21 Dec 2004 20:43:14 -0500 To: "Greg 'groggy' Lehey" <grog@FreeBSD.org>
On Wed, Dec 22, 2004 at 11:31:43AM +1030, Greg 'groggy' Lehey wrote:
> 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?
I think you'll screw up an awful lot of people that #ifdef based upon
the errno names.
-- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Joe Kelsey: "Re: Fixing Posix semaphores"
- In reply to: Greg 'groggy' Lehey: "Header files with enums instead of defines?"
- Next in thread: Greg 'groggy' Lehey: "Re: Header files with enums instead of defines?"
- Reply: Greg 'groggy' Lehey: "Re: Header files with enums instead of defines?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|