This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3 PATCH] Fix Cygwin bootstrap failure: ECANCELED in system_error


The following patch fixes the current libstdc++ bootstrap failure on i686-pc-cygwin. The issue is that the new system_error header file unconditionally uses the value ECANCELED. Alas not all almost POSIX systems provide this value in sys/errno.h.

The fix is similar to Ben Kosnik's previous fix for FreeBSD, and my previous fix for Darwin, to add a suitable configure check, and then guard the usage of ECANCEL and std::operation_canceled by _GLIBCXX_HAVE_ECANCELED.

The following patch has been tested on both i686-pc-cygwin and x86_64-unknown-linux-gnu with a full "make bootstrap", where it allows the former to complete without problems. I then ran a top-level "make -k check" on the later to confirm that there are no new libstdc++ testsuite failures.

Ok for mainline?

2007-09-09 Roger Sayle <roger@eyesopen.com>

* acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add ECANCELED for cygwin.
* configure: Regenerate.
* config/os/generic/error_constants.h: Guard.
* testsuite/19_diagnostics/headers/system_error/
types_std_c++0x.cc: Same.



I'm unsure as to the standard wording for system_error, but I was wondering if rather than removing the symbols operation_canceled and bad_message from the std namespace on affected platforms, we retain them but assign them a unique value. This then preserves source code compatability of C++ user code, it's just that the OS won't ever generate an errno value of operation_canceled. I was giving some thought to how one could assign these unique values when I discovered that E-values aren't required to be unique. Several OSes #define one value to another. i.e. #define EAGAIN EWOULDBLOCK. If this is permitted, it means that these constants can't be used in switch statements, because they are not guaranteed unique. This would simplify things to the point that on affected platforms we could simply have "operation_canceled = 0", "bad_message = 0" etc... Thoughts?



Roger --

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]