This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/31836] [4.3 Regression] FAIL: 27_io/basic_istream/extractors_arithmetic/char/12.cc execution test



------- Comment #27 from dave at hiauly1 dot hia dot nrc dot ca  2007-05-12 02:23 -------
Subject: Re:  [4.3 Regression] FAIL:
27_io/basic_istream/extractors_arithmetic/char/12.cc execution test

> An additional remark on hppa: a *theoretical* possibility is that on hppa
> strtold (or sscanf), even if infinities are available, doesn't return an
> infinity in case of input overflow. As far as I know, that is strictly mandated
> only in C99. In that case, we could strengthen the check on
> __LDBL_HAS_INFINITY__ to one on _GLIBCXX_USE_C99, for example.

That's it.  From the manpage:

      If the correct value would cause overflow, positive _LDBL_MAX or
      negative _LDBL_NMAX is returned (according to the sign of the value),
      and errno is set to ERANGE.  The __LDBL_MAX and __LDBL_NMAX macros are
      provided to assist in checking the return values against _LDBL_MAX and
      _LDBL_NMAX.

      If the correct value would cause underflow, _ZERO is returned and
      errno is set to ERANGE.

So, I guess we have to check errno.

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31836


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