From owner-freebsd-arch Mon Jul 9 5:23: 8 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by hub.freebsd.org (Postfix) with ESMTP id D6D5637B405 for ; Mon, 9 Jul 2001 05:23:04 -0700 (PDT) (envelope-from brandt@fokus.gmd.de) Received: from beagle (beagle [193.175.132.100]) by mailhub.fokus.gmd.de (8.8.8/8.8.8) with ESMTP id OAA17296; Mon, 9 Jul 2001 14:22:51 +0200 (MET DST) Date: Mon, 9 Jul 2001 14:22:51 +0200 (CEST) From: Harti Brandt To: Bruce Evans Cc: Subject: Re: -fno-builtin In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 9 Jul 2001, Bruce Evans wrote: BE>On 9 Jul 2001, Dag-Erling Smorgrav wrote: BE> BE>> Bruce Evans writes: BE>> > Unfortunately, the inline function version doesn't work right, at least BE>> > on i386's: __builtin_strlen("foo") gives code that loads the constant BE>> > result 3, but the inline strlen("foo") gives code that scans the string. BE>> BE>> What about a macro? BE>> BE>> #define strlen(s) __builtin_strlen(s) BE>> BE>> Would this work? BE> BE>I think it would work right except in broken code which "knows" that BE>strlen isn't a macro, e.g.: BE> BE> size_t (*p)(const char *s) = strlen; Why is that broken? My last copy of the ISO-C draft specifically states, that strlen is a function. (Not that I intend to use that construct. Just beeing curious). harti -- harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.gmd.de, harti@begemot.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message