Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750834AbVKWOca (ORCPT ); Wed, 23 Nov 2005 09:32:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750835AbVKWOca (ORCPT ); Wed, 23 Nov 2005 09:32:30 -0500 Received: from 167.imtp.Ilyichevsk.Odessa.UA ([195.66.192.167]:37013 "HELO port.imtp.ilyichevsk.odessa.ua") by vger.kernel.org with SMTP id S1750834AbVKWOc3 (ORCPT ); Wed, 23 Nov 2005 09:32:29 -0500 From: Denis Vlasenko To: moreau francis Subject: Re: Use enum to declare errno values Date: Wed, 23 Nov 2005 16:31:12 +0200 User-Agent: KMail/1.8.2 Cc: linux-kernel@vger.kernel.org References: <20051123132443.32793.qmail@web25813.mail.ukl.yahoo.com> In-Reply-To: <20051123132443.32793.qmail@web25813.mail.ukl.yahoo.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200511231631.12365.vda@ilport.com.ua> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 783 Lines: 26 On Wednesday 23 November 2005 15:24, moreau francis wrote: > Hi, > > I'm just wondering why not declaring errno values using enumaration ? It is > just more convenient when debuging the kernel. 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 }; Maybe a macro could help #define CONST(a, N) enaum { a = N } CONST(ABC, 123); CONST(DEF, 456); -- vda - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/