erik65536 added a subscriber: erik65536.
erik65536 added a comment.

The C++ spec states that `error_category::message()` shall not change the value 
of `errno` (See section 19.5). So `errno` will have to be saved and restored if 
`strerror_r()` fails.

The POSIX version of `strerror_r()` returns 0 on success, and any other value 
indicates an error (Reference 
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html>).

The function may return uninitialized memory if `std::snprintf()` fails.

You may want to a version for Windows that calls `strerror_s()`.


http://reviews.llvm.org/D20903



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to