This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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


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).

-- 
Joseph S. Myers
joseph@codesourcery.com


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