svn commit: trunk/busybox/util-linux

Jason Schoon floydpink at gmail.com
Tue Sep 19 16:30:26 UTC 2006


On 9/19/06, Denis Vlasenko <vda.linux at googlemail.com> wrote:
>
> On Tuesday 19 September 2006 15:18, Bernhard Fischer wrote:
> > On Mon, Sep 18, 2006 at 10:53:08AM -0400, Rob Landley wrote:
> > >On Sunday 17 September 2006 11:51 am, vda at busybox.net wrote:
> > >> -#define useMtab 0
> > >> -#define fakeIt 0
> > >> +enum {
> > >> +  useMtab = 0,
> > >> +  fakeIt = 0,
> > >> +};
> > >
> > >Ok, your argument a moment ago in favor of using enum was scoping
> rules, and
> > >here you're making a global enum.
> > >
> > >Anybody else see an inconsistency here?
> >
> > I don't like these enums. IMHO they are not readable and -- compared to
> > defines -- don't come with any advantage whatsoever.
>
> Okay, let's say you do
>
> #define linenumber 0
>
> What will happen if somebody, somewhere in the jungle of included
> header files, already used "linenumber" as a name for something?
>
> With enum, you'll get understandable error message.


Umm, with lint for certain, and I thought with most newer compilers, you
will get a "linenumber redefined" type of message.

I'm chiming in on the side of #defines here, fwiw.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060919/cd9faa19/attachment-0002.htm 


More information about the busybox mailing list