delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/01/03/17:37:35

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Message-ID: <3FF746F4.1030408@phekda.gotadsl.co.uk>
Date: Sat, 03 Jan 2004 22:49:24 +0000
From: Richard Dawe <rich AT phekda DOT gotadsl DOT co DOT uk>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031031
X-Accept-Language: en, de, fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Patch for doprnt.c in djgpp v204 Beta
References: <185 DOT 2489dbc9 DOT 2d2885a2 AT aol DOT com>
In-Reply-To: <185.2489dbc9.2d2885a2@aol.com>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Kbwms AT aol DOT com wrote:
> There continues to be a conflict with symbol 'roundl' in doprnt.c and 
> the C99 function roundl().  A suggested fix that works is:
> 
> --- src/libc/ansi/stdio/doprnt.c 2003-11-08 07:19:40.000000000 -0500
> +++ c:/gputil/doprnt.c 2004-01-03 15:36:26.000000000 -0500
[snip]
> static char *
> -roundl(long double fract, int *expv, char *start, char *end, char ch,
> +__roundl(long double fract, int *expv, char *start, char *end, char ch,
>         char *signp)
> {
>    long double tmp;

Presumably the conflict is because the prototypes differ?

I don't think renaming it to __roundl is the right solution. If we ever 
use (the C99) roundl in a non-C99 function in libc, we will need a stub 
for it, to avoid polluting the global namespace. In that case, (the C99) 
roundl will be available in two versions: a stub called roundl for C99 
programs and a stub called __roundl that will be used internally in the 
library. So there will still be a clash.

Stubs are explained in the developer's section of the DJGPP knowledge 
base ("info kb").

I suggest renaming the function to some other name.

Perhaps prefix it with "doprnt_", e.g.: doprnt_roundl. That's kind of 
ugly. It would probably need to be done to the other internal functions 
too: cvtl, roundl, exponentl, isspeciall.

A name related to its function would be better, but I can't think of a 
non-ugly name now. I'm sure someone else can do better.

Bye, Rich =]

-- 
Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ]

"You can't evaluate a man by logic alone."
   -- McCoy, "I, Mudd", Star Trek

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019