This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: log2, log2f
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: newlib at sources dot redhat dot com, "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>, Eric Blake <ebb9 at byu dot net>
- Date: Wed, 18 Mar 2009 11:28:31 -0400
- Subject: Re: log2, log2f
- References: <49C05350.601@users.sourceforge.net> <49C0E3EF.4070308@byu.net>
On Wed, Mar 18, 2009 at 06:07:11AM -0600, Eric Blake wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>According to Yaakov (Cygwin/X) on 3/17/2009 7:50 PM:
>> SUSv3 requires that log2 and log2f be defined as functions (at least)
>> and may also be defined as macros. Right now, though, these are only
>> defined as macros, and besides being noncompliant, it also creates false
>> negatives with configure AC_CHECK_FUNC[S] tests.
>>
>> Here's my first attempt at a patch to define these as functions instead.
>
>Your patch adds the functions (good) but deletes the macros. SUSv3 (and
>v4) allow these to be macros in addition to functions. Since the body is
>so trivial, maybe it is worth keeping the macro around to avoid the
>penalty of an extra function call, with minimal impact to code size in the
>common usage of log2?
I discussed this with Yaakov on irc but how would you do this exactly? Where
would you define the function if log2 is already defined as a macro?
cgf