From: Jonathan Wakely Date: Thu, 1 Oct 2015 16:02:54 +0000 (+0100) Subject: * doc/html/manual/errno.html: Add new file. X-Git-Tag: basepoints/gcc-7~4238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b8089a3c65706af612097ce10280cb4858512d2;p=thirdparty%2Fgcc.git * doc/html/manual/errno.html: Add new file. From-SVN: r228348 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4199ede06fda..8dcf1bdd2ea9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,7 @@ 2015-10-01 Jonathan Wakely + * doc/html/manual/errno.html: Add new file. + * doc/xml/manual/diagnostics.xml: Document use of errno. * doc/html/*: Regenerate. * config/locale/generic/c_locale.cc (_Save_errno): New helper. diff --git a/libstdc++-v3/doc/html/manual/errno.html b/libstdc++-v3/doc/html/manual/errno.html new file mode 100644 index 000000000000..5daeda73ac9e --- /dev/null +++ b/libstdc++-v3/doc/html/manual/errno.html @@ -0,0 +1,30 @@ + +Use of errno by the library

Use of errno by the library

+ The C and POSIX standards guarantee that errno + is never set to zero by any library function. + The C++ standard has less to say about when errno + is or isn't set, but libstdc++ follows the same rule and never sets + it to zero. +

+ On the other hand, there are few guarantees about when the C++ library + sets errno on error, beyond what is specified for + functions that come from the C library. + For example, when std::stoi throws an exception of + type std::out_of_range, errno + may or may not have been set to ERANGE. +

+ Parts of the C++ library may be implemented in terms of C library + functions, which may result in errno being set + with no explicit call to a C function. For example, on a target where + operator new uses malloc + a failed memory allocation with operator new might + set errno to ENOMEM. + Which C++ library functions can set errno in this way + is unspecified because it may vary between platforms and between releases. +

\ No newline at end of file