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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2006-08-21 at 17:01 +0400, Evgeniy Polyakov wrote:
[ #define vs enum { } ]
> 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.

Oops, I stand corrected.

> 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.

ACK. Personally I also do not care that much - as long as it doesn't
change with the phase of the moon.
And we probably do not want
----  snip  ----
#ifdef CONFIG_I_LOVE_ENUMS
#define A 1
#define B 2
#define C 4
#else
enum {
	A = 1,
	B = 2,
	C = 4,
};
#endif
----  snip  ----
either.

	Bernd, shutting now up on this thread
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux