From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 26 21:02:31 2009 Return-Path: Delivered-To: hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A26010656C2 for ; Thu, 26 Feb 2009 21:02:31 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id EC4678FC17 for ; Thu, 26 Feb 2009 21:02:30 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 26 Feb 2009 21:02:29 -0000 Received: from p54A3E686.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.230.134] by mail.gmx.net (mp070) with SMTP; 26 Feb 2009 22:02:29 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1/oRDVESLroiFEPgXW+KOyvXmvK4ScR6gXHNI0CBL UPkJUpPTMg4K28 Message-ID: <49A70364.1020707@gmx.de> Date: Thu, 26 Feb 2009 22:02:28 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Ed Schouten , hackers@FreeBSD.ORG References: <20090226180756.GX19161@hoeg.nl> <20090226204243.GA96251@zim.MIT.EDU> <49A70092.6030601@gmx.de> In-Reply-To: <49A70092.6030601@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 Cc: Subject: Re: Renaming all symbols in libmp(3) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2009 21:02:32 -0000 Christoph Mallon schrieb: > David Schultz schrieb: >> On Thu, Feb 26, 2009, Ed Schouten wrote: >>> One of the reasons why we can't compile the base system yet, is because >>> some applications in the base system (keyserv, newkey, chkey, libtelnet) >>> won't compile, because a library they depend (libmp)on has a function >>> called pow(). By default, LLVM has a built-in prototype of pow(), >>> similar to GCC. Unlike GCC, LLVM raises a compiler error by default. The >>> manual page also mentions this issue. >> >> I think most apps that used to use libmp have transitioned to >> libgmp, so I don't have much of an opinion on this change... >> >> However, if the compiler as a builtin for the math.h-style pow() >> function, and the builtin causes it to choke even when math.h >> isn't #included, that's a bug in the compiler. The people who are >> proposing that we make the base system LLVM-compatible should be >> more forceful in insisting that LLVM be fixed. ;-) What do the LLVM >> folks propose to do about all the (perfectly legal) programs out >> there that have a variable called 'exp'? > > No, it's invalid code to have a function named pow() in a hosted > environment which is not /The/ pow(). > Having a *local* variable named exp is fine, because this declaration > shadows the function. A *global* variable on the other hand is not allowed. Just a hint, why you really mustn't use global names which are reserved by the standard: double pow(double x, double y) { abort(); } int main(void) { printf("%f\n", pow(10., 2.)); return 0; } %gcc -w bla.c %./a.out 100.000000 % Yes, GCC does that and it's perfectly valid.