Wireshark mailing list archives
Re: enum or #define?
From: Guy Harris <guy () alum mit edu>
Date: Mon, 15 Feb 2010 00:00:06 -0800
On Feb 14, 2010, at 10:49 PM, Jaap Keuter wrote:
That would probably be #1. This option makes verification against a protocol spec / RFC easiest,
...and 1) means some debuggers will, for values of the enum type in question, be able to print the value symbolically rather than numerically and 2) means that some compilers will warn, if you switch on the enum type in question, if you don't have a case for each of the known values of the enum. (At least one of the debuggers, and one of the compilers, in question, have names beginning with the letter "g", if you're curious. :-)) ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- enum or #define? Kaul (Feb 14)
- Re: enum or #define? Jaap Keuter (Feb 14)
- Re: enum or #define? Guy Harris (Feb 15)
- Re: enum or #define? Mike Morrin (Feb 15)
- Re: enum or #define? Guy Harris (Feb 15)
- Re: enum or #define? Jaap Keuter (Feb 14)