From 7b8089a3c65706af612097ce10280cb4858512d2 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 1 Oct 2015 17:02:54 +0100 Subject: [PATCH] * doc/html/manual/errno.html: Add new file. From-SVN: r228348 --- libstdc++-v3/ChangeLog | 2 ++ libstdc++-v3/doc/html/manual/errno.html | 30 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 libstdc++-v3/doc/html/manual/errno.html diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4199ede06fd..8dcf1bdd2ea 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 00000000000..5daeda73ac9 --- /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 -- 2.30.2