Make libstdc++ use strtold on MinGW
Kai Tietz
Kai.Tietz@onevision.com
Mon Mar 10 08:31:00 GMT 2008
"Joseph S. Myers" <joseph@codesourcery.com> wrote on 28.02.2008 23:48:07:
> On Thu, 28 Feb 2008, NightStrike wrote:
>
> > On 2/28/08, Joseph S. Myers <joseph@codesourcery.com> wrote:
> > > libstdc++ has code (in config/locale/generic/c_locale.cc) that uses
> > > strtold to convert strings to long double if available, falling back
> > > to scanf %Lf if strtold is not available. MinGW has strtold - but
> > > does not have working scanf %Lf (Kai Tietz's patch correctly records
> > > this format as unavailable on Windows). Thus it's important for
> >
> >
> > How does this affect the patch that Kai is working on?
>
> If the relevant parts of libstdc++ are compiled with -Wformat, Kai's
patch
> would have correctly diagnosed the problem with the present code
(whether
> anyone would have noticed the warning and fixed it, as opposed to my
> finding the problem through investigating test failures, is another
> matter). Likewise with the printf code (there's an interesting issue
> there: Windows printf doesn't support long double, but MinGW replaces
> snprintf and vsnprintf only with versions that do, so a diagnostic is
> strictly only correct for a subset of printf-family functions).
I don't think there is a special treating of the overriden functions
snprintf and vsnprintf necessary. AFAIK they are reflections of the
implementation functions mingw_snprintf and mingw_vsnprintf. So they have
simply the gnu_printf attribute and not the ms_printf one. The system
functions snprintf (and vsnprintf) are still ms_printf formats.
Cheers,
i.A. Kai Tietz
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer:
Ulrike Döhler, Manuela Kluger
More information about the Libstdc++
mailing list