[v3] system_error, round one

Beman Dawes bdawes@acm.org
Wed May 16 13:09:00 GMT 2007


Ulrich Drepper wrote:

> And I would definitely do away the "other" thing. As I wrote, new
> error codes are not an exception which must be flagged, they are
> introduced pretty regularly. The C++ runtime cannot be written to
> flip out when t his happens or drop the information. Fold all
> additional error codes into "other" drop information. Programmers
> won't be able to determine what really happened.

The native category errors should always report the exact error code 
returned by the operating system, and should never fold that exact error 
code into something else. Allowing the programmer to determine exactly 
what happened is why the native category exists.

Some application, however, need to write portable code that is 
independent of the native operating system. They can use the posix() 
member function to obtain the portable posix_errno value. By definition, 
that must meet the POSIX spec, and so needs a value for codes that don't 
translate well into one of the posix_errno codes.

--Beman Dawes



More information about the Libstdc++ mailing list