This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Make libstdc++ use strtold on MinGW


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]