Opened 13 years ago

Closed 13 years ago

#3927 closed Bugs (fixed)

system_error::what() doesn't incorporate code.message() if this->code().value() == 0

Reported by: Dmitry Goncharov <dgoncharov@…> Owned by: Beman Dawes
Milestone: Boost 1.43.0 Component: system
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:

Description

if error_code is given 0 as the first argument then system_error::what() ignores code().message().

This piece of code

boost::system::error_code const ec(0, boost::system::system_category);
boost::system::system_error se(ec);
cout << se.what() << endl;

will not print anything. "Success" is expected.

Attachments (1)

system_error.patch (633 bytes ) - added by Dmitry Goncharov <dgoncharov@…> 13 years ago.
This patch fixes the bug. Tested on linux with gcc-4.4.2 and freebsd with gcc-4.2.1

Download all attachments as: .zip

Change History (2)

by Dmitry Goncharov <dgoncharov@…>, 13 years ago

Attachment: system_error.patch added

This patch fixes the bug. Tested on linux with gcc-4.4.2 and freebsd with gcc-4.2.1

comment:1 by Beman Dawes, 13 years ago

Resolution: fixed
Status: newclosed

(In [59673]) Fix #3927

Note: See TracTickets for help on using tickets.