delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/03/20:19:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199911040017.QAA27536@aleph.ssd.hal.com>
Subject: Re: sys_errlist
To: cygwin AT sourceware DOT cygnus DOT com (Cygwin Mailing List)
Date: Wed, 3 Nov 1999 16:17:34 -0800 (PST)
In-Reply-To: <199911032311.PAA27494@aleph.ssd.hal.com> from "J. J. Farrell" at Nov 3, 99 03:11:15 pm
From: "J. J. Farrell" <jjf AT bcs DOT org DOT uk>
X-Mailer: ELM [version 2.4 PL23]

> From: "J. J. Farrell" <jjf AT bcs DOT org DOT uk>
> 
> Since the non-underscore versions are required to be present in
> the interface definition which many modern UNIXes are based on,
> I'd say that cygwin should expose them, but no-cygwin shouldn't.
> Is it possible to expose them in a way which makes user declaration
> work, as mandated by the SVID, rather than requiring the <errno.h>
> inclusion? Both should expose the underscore versions since there's
> no harm doing so.

To add another confusing data point, I've just noticed that Microsoft
Visual C 6.0 declares _sys_errlist and _sys_nerr in <stdlib.h> rather
that <errno.h>; and if the compiler is not running in "strict ANSI"
mode and doesn't have _POSIX_ defined, it also declares sys_errlist
and sys_nerr in <stdlib.h>.

I don't know if the optimum solution can be achieved, but it would
look like:

- when in maximum UNIX compatibility mode, just declaring

    extern char *sys_errlist[]; extern int sys_nerr;

  in the code should work. Failing this, removing these declarations
  and including <errno.h> seems a reasonable option since such code
  will almost certainly be including <errno.h> already. The versions
  with leading underscores should probably be made available in the
  same way.

- when in  maximum VC++ compatibility mode, the leading underscore
  versions should be made available by including <stdlib.h>; if not
  in strict Standard C mode, the non-underscore versions should be
  available in the same way.

If it isn't possible to support declarations in the code, the simplest
solution is probably that both <errno.h> and <stdlib.h> should declare
the leading underscore names, and if not in strict Standard C mode
they should #define the no-underscore names to the underscore ones.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019