Thread (180 messages) 180 messages, 22 authors, 2006-08-22

Re: [take9 1/2] kevent: Core files.

From: Evgeniy Polyakov <hidden>
Date: 2006-08-21 13:02:12
Also in: lkml

On Mon, Aug 21, 2006 at 02:53:25PM +0200, Bernd Petrovitsch (bernd@firmix.at) wrote:
On Mon, 2006-08-21 at 15:13 +0400, Evgeniy Polyakov wrote:
[...]
quoted
And what is the difference between
As others already pointed out in this thread:

These are not seen by the C compiler.
quoted
#define A 1
#define B 2
#define C 4
and
These are known by the C compiler and thus usable/viewable in a
debugger.
quoted
enum {
 A = 1,
 B = 2,
 C = 4,
}
?
:) And I pointed quite a few other issues about enums vs. defines.
According to this one - no one wants to watch enums in debugger.

And, ugh:

(gdb) list
1       enum {
2               A = 1,
3               B = 2,
4       };
5
6       int main()
7       {
8               printf("%x\n", A | B);
9       }
(gdb) bre 8
Breakpoint 1 at 0x4004ac: file ./test.c, line 8.
(gdb) r
Starting program: /tmp/test 

Breakpoint 1, main () at ./test.c:8
8               printf("%x\n", A | B);
(gdb) p A
No symbol "A" in current context.


Actually I completely do not care about define or enums, it is really
silly dispute, I just do not want to rewrite bunch of code _again_ and
then _again_ when someone decide that defines are better.

-- 
	Evgeniy Polyakov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help