public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] [Fwd: [ECOS] printf and floating point emulation]
@ 2008-04-09 16:58 Eduardo Sabaj
  2008-04-09 18:24 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Eduardo Sabaj @ 2008-04-09 16:58 UTC (permalink / raw)
  To: ecos-discuss

I found that the problem is the function vfnprint () located in 
vfnprintf.cxx. It calls cvt() and this function calls modf(). This last 
function seems to be the problem. This is the code extracted from cvt() :
                ...
        for (p = endp - 1; integer; ++expcnt) {
                tmp = modf(integer / 10, &integer);
                *p-- = to_char((int)((tmp + .01) * 10));
        }
                ...

This loop never ends!

Am I omiting any patch? Please I need help. If you have any suggestion 
write me as soon as you can.
Regards,
Eduardo


-------- Mensaje original --------
Asunto: 	[ECOS] printf and floating point emulation
Fecha: 	Tue, 08 Apr 2008 16:55:09 -0300
De: 	Eduardo Sabaj <esabaj@hasar.com>
Para: 	ecos-discuss@ecos.sourceware.org



I have a program that hangs when trying to format and print something 
like this:

void
func (float f)
{
   printf ("%.2f\n", f);
}

I don't have an FPU builtin hardware.
The CPPFLAGS and LDFLAGS include the following options:

-msoft-float -mno-fp-ret-in-387 -mno-fancy-math-387

I disabled the FPU support (macro CYGHWR_HAL_I386_FPU) and I enabled 
CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT and 
CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT macros.

I'm running ecos-2.0 (the last version available in CVS).

Please, I cannot realize what I'm omiting.. Any idea?

-- 

Ing. Eduardo Salvador Sabaj
Analista de Desarrollo

Compañía Hasar | Grupo Hasar*
*Marcos Sastre y José Ingenieros
El Talar. Pacheco
[B1618CSD] Buenos Aires. Argentina
Tel [54 11] 4117 8900 | Fax [54 11] 4117 8998
E-mail: esabaj@hasar.com
Visítenos en: www.hasar.com
<http://www.hasar.com>Información legal y política de confidencialidad: 
www.grupohasar.com/disclaimer <http://www.grupohasar.com/disclaimer>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss




<http://www.grupohasar.com/disclaimer> 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-04-10 14:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 16:58 [ECOS] [Fwd: [ECOS] printf and floating point emulation] Eduardo Sabaj
2008-04-09 18:24 ` Andrew Lunn
2008-04-09 18:46   ` Eduardo Sabaj
2008-04-10  6:12     ` Andrew Lunn
2008-04-10 14:42       ` Eduardo Sabaj
     [not found]       ` <47FE1CCC.2070001@hasar.com>
2008-04-10 19:07         ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).