Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 29 Aug 2002 11:44:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 29 Aug 2002 11:44:24 -0400 Received: from ns.suse.de ([213.95.15.193]:48392 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id ; Thu, 29 Aug 2002 11:44:24 -0400 Date: Thu, 29 Aug 2002 17:48:45 +0200 From: Dave Jones To: Thunder from the hill Cc: Rusty Russell , junio@siamese.dyndns.org, Linux Kernel Mailing List Subject: Re: [TRIVIAL] strlen("literal string") -> (sizeof("literal string")-1) Message-ID: <20020829174845.G17887@suse.de> Mail-Followup-To: Dave Jones , Thunder from the hill , Rusty Russell , junio@siamese.dyndns.org, Linux Kernel Mailing List References: <20020828221716.1A73C2C09E@lists.samba.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from thunder@lightweight.ods.org on Thu, Aug 29, 2002 at 09:39:14AM -0600 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 787 Lines: 22 On Thu, Aug 29, 2002 at 09:39:14AM -0600, Thunder from the hill wrote: > > #define strlen(x) \ > > (__builtin_constant_p(x) && sizeof(x) != sizeof(char *) > > ? (sizeof(x) - 1) : __strlen(x)) > > I must say that doesn't make the code any cleaner, which leads to it being > not as clean as Keith suggested. It was a code cleanup, not a code messup. Sure the macro is fugly, but the code that uses it becomes cleaner which was the whole point here. Dave -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs - 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/