mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: moreau francis <francis_moreau2000@yahoo.fr>,
	linux-kernel@vger.kernel.org
Subject: Re: Use enum to declare errno values
Date: Wed, 23 Nov 2005 12:35:07 -0500	[thread overview]
Message-ID: <4384A84B.5080709@tmr.com> (raw)
In-Reply-To: <1132758910.7268.32.camel@localhost.localdomain>

Alan Cox wrote:
> On Mer, 2005-11-23 at 16:31 +0200, Denis Vlasenko wrote:
> 
>>Enums are really nice substitute for integer constants instead of #defines.
>>Enums obey scope rules, #defines do not.
>>
>>However enums are not widely used because of
>>1. tradition and style
>>2. awkward syntax required:   enum { ABC = 123 };
> 
> 
> The SATA layer uses enum for constants and while it was a bit of change
> in style when I met it, it does seem to work just as well
> 

Well, perhaps better, since there is some type checking, and where 
auto-increment can be used finger checks don't generate duplicate values 
or undefined holes in the value set.

Like the struct definitions vs. old K&R definitions, there is a mental 
style adjustment to be made.
-- 
    -bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
  last possible moment - but no longer"  -me


  parent reply	other threads:[~2005-11-23 17:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-23 13:24 moreau francis
2005-11-23 14:19 ` linux-os (Dick Johnson)
2005-11-23 14:24   ` Denis Vlasenko
2005-11-23 15:00     ` linux-os (Dick Johnson)
2005-11-24  7:19       ` Denis Vlasenko
2005-11-24  7:30         ` Paul Jackson
2005-11-24  7:37           ` Paul Jackson
2005-12-01 20:01           ` linux-os (Dick Johnson)
2005-12-02  6:49             ` Denis Vlasenko
2005-12-02  9:27               ` Coywolf Qi Hunt
2005-12-02 12:07                 ` Denis Vlasenko
2005-12-02 12:18                 ` Pekka Enberg
2005-12-02 12:56                   ` Coywolf Qi Hunt
2005-12-02 13:20                     ` Denis Vlasenko
2005-12-02 13:34                     ` Pekka Enberg
2005-12-02 16:02                     ` Bill Davidsen
2005-12-02 16:32                       ` Coywolf Qi Hunt
2005-12-02 16:56                       ` Vadim Lobanov
2005-12-04 13:10                         ` Denis Vlasenko
2005-12-02 16:15                 ` Bill Davidsen
2005-12-02 17:07                   ` Coywolf Qi Hunt
2005-12-02 17:51                     ` Steven Rostedt
2005-12-02 18:15                     ` Bill Davidsen
2005-12-02 18:30                     ` Horst von Brand
2005-11-23 14:27 ` Denis Vlasenko
2005-11-23 14:31 ` Denis Vlasenko
2005-11-23 15:15   ` Alan Cox
2005-11-23 15:44     ` moreau francis
2005-11-23 15:55       ` Nikita Danilov
2005-11-23 16:05         ` moreau francis
2005-11-23 16:24           ` Nikita Danilov
2005-11-23 16:42             ` moreau francis
2005-11-23 16:54               ` Nikita Danilov
2005-11-24  7:22       ` Denis Vlasenko
2005-11-23 17:35     ` Bill Davidsen [this message]
2005-11-24  9:43   ` Giuliano Pochini
2005-11-28 23:19     ` Bill Davidsen
2005-11-24 17:11 ` Ben Pfaff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4384A84B.5080709@tmr.com \
    --to=davidsen@tmr.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=francis_moreau2000@yahoo.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome