Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750760AbVKWPzy (ORCPT ); Wed, 23 Nov 2005 10:55:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750837AbVKWPzy (ORCPT ); Wed, 23 Nov 2005 10:55:54 -0500 Received: from moraine.clusterfs.com ([66.96.26.190]:35554 "EHLO moraine.clusterfs.com") by vger.kernel.org with ESMTP id S1750760AbVKWPzx (ORCPT ); Wed, 23 Nov 2005 10:55:53 -0500 From: Nikita Danilov MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17284.37107.573883.328659@gargle.gargle.HOWL> Date: Wed, 23 Nov 2005 18:55:31 +0300 To: moreau francis Cc: linux-kernel@vger.kernel.org Subject: Re: Use enum to declare errno values Newsgroups: gmane.linux.kernel In-Reply-To: <20051123154423.32867.qmail@web25802.mail.ukl.yahoo.com> References: <1132758910.7268.32.camel@localhost.localdomain> <20051123154423.32867.qmail@web25802.mail.ukl.yahoo.com> X-Mailer: VM 7.17 under 21.5 (patch 17) "chayote" (+CVS-20040321) XEmacs Lucid Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 999 Lines: 48 moreau francis writes: [...] > > I guess we won't use enumeration because it needs to many changes...Each > function that returns a errno value should have their prototype changed like > this: > > int foo(void) > { > int retval; > [...] > return retval; > } > > should be changed into > > enum errnoval foo(void) > { > enum errnoval retval; > [...] > return retval; > } No it shouldn't. Following is a perfectly legal thing to do in C: enum side { LEFT, RIGHT }; int foo(int x) { if (x & 0x1) return LEFT; else return RIGHT; } This is not C++ fortunately. Nikita. - 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/