This is the mail archive of the
mailing list for the GCC project.
Re: [patch] GNAT s-oscons-tmplt.c multiple undefined errnos
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Arnaud Charlet <charlet at adacore dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Thomas Quinot <quinot at adacore dot com>
- Date: Tue, 13 Apr 2010 09:10:10 -0500
- Subject: Re: [patch] GNAT s-oscons-tmplt.c multiple undefined errnos
- References: <4BC474E7.firstname.lastname@example.org> <20100413140357.GA36628@adacore.com>
On 04/13/2010 09:03 AM, Arnaud Charlet wrote:
The file s-oscons-tmplt.c defines all the errnoI've asked Thomas to review your change which is not OK:
constants not available on a target to -1. When
a target is missing the right combination of two
or more errno's, there is a case statement in
g-socket.adb (Resolve_Error) which ends up with
two when's with -1 which is an error. The attached
patch gives each undefined errno a unique value.
The patch does not achieve its objective:
+# define ECONNREFUSED -8
+# define ECONNRESET -8
So in any case it need to be fixed.
More generally I don't really like the idea of essentially ignoring
undefined errno values, and we should ask Joel what specific situation
he is trying to address, and what are the specific missing values he is
seeing, and discuss how best to address that on a case-by-case basis.
There is really no justification in providing junk values for these
constants, and the expected situation really is to have them all defined
(technically we should #error in any case where the macro isn't already
You are expecting errnos not defined by POSIX to be there.
newlib has gone to a fairly pure set of POSIX errnos. Would
it be better to just rewrite the g-socket.adb case into a
series of if's
Joel Sherrill, Ph.D. Director of Research& Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985