Pointless configure checks for <errno.h> macros

Jonathan Wakely jwakely@redhat.com
Thu Nov 12 09:17:00 GMT 2015


PR68307 points out that config/os/mingw32-w64/error_constants.h fails
to define a number of errc constants which correspond to EXXX macros
that are supported on mingw-w64.

Does anyone know why we test explicitly for these macros but not
others?

m4_foreach([syserr], [EOWNERDEAD, ENOTRECOVERABLE, ENOLINK, EPROTO, ENODATA,
          ENOSR, ENOSTR, ETIME, EBADMSG, ECANCELED,
          EOVERFLOW, ENOTSUP, EIDRM, ETXTBSY,
          ECHILD, ENOSPC, EPERM,
          ETIMEDOUT, EWOULDBLOCK],

Why do we even test for these in configure, instead of just checking
whether they exist directly using #ifdef in error_constants.h ?

(This was discussed in
https://gcc.gnu.org/ml/libstdc++/2011-08/msg00125.html where Paolo
questioned the value of these checks, but indicated a preference for
consistency).

A bit of (incomplete) archaeology suggests that at one time we defined
all of these in <system_error>, but later split them out into
OS-specific error_constants.h files. If we have a file specific to
mingw-w64 can we just uncomment the constants known to be supported by
that target?

This patch uncomments all the constants with a corresponding macro in
mingw-w64-headers/crt/errno.h in the mingw-w64 sources.

2015-11-12  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/68307
	* config/os/mingw32-w64/error_constants.h: Uncomment all error codes
	supported by mingw-w64.

Is there any problem doing this?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 4882 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20151112/0d010b55/attachment.bin>


More information about the Libstdc++ mailing list