This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [patch] GNAT s-oscons-tmplt.c multiple undefined errnos


On 04/13/2010 09:03 AM, Arnaud Charlet wrote:
The file s-oscons-tmplt.c defines all the errno
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.
I've asked Thomas to review your change which is not OK:

<<
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
defined).

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

Thomas.


--
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



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