bug in ozostream.cc @ mozart-1-3-0-fixes

Filip Konvicka filip.konvicka.removethisantispamtoken at logis.cz
Sun Apr 16 18:04:06 CEST 2006


I've submitted bug report #1869. The problem is that the $ printf 
notation is not standard C++.

Filip

> Hi,
> 
> the recent Mozart 1-3-0-fixes prints some garbage instead of floats 
> (like "$.*1$g"). See the included patch.
> 
> Cheers,
> Filip
> 
> 
> ------------------------------------------------------------------------
> 
> Index: platform/emulator/ozostream.cc
> ===================================================================
> RCS file: /services/mozart/CVS/mozart/platform/emulator/ozostream.cc,v
> retrieving revision 1.18.18.1
> diff -u -r1.18.18.1 ozostream.cc
> --- platform/emulator/ozostream.cc	21 Feb 2006 09:36:05 -0000	1.18.18.1
> +++ platform/emulator/ozostream.cc	16 Apr 2006 08:43:22 -0000
> @@ -83,9 +83,9 @@
>  {
>    char buf[100];
>    if (ozconf.printScientificFloats)
> -    sprintf(buf,"%2$.*1$e",ozconf.printFloatPrecision,d);
> +    sprintf(buf,"%2.*e",ozconf.printFloatPrecision,d);
>    else
> -    sprintf(buf,"%2$.*1$g",ozconf.printFloatPrecision,d);
> +    sprintf(buf,"%2.*g",ozconf.printFloatPrecision,d);
>    return *this << buf;
>  }
>  




More information about the mozart-hackers mailing list