Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <028901c0d5fe$3a4c6af0$0200a8c0@lifelesswks> From: "Robert Collins" To: "Andreas Eibach" , References: <002b01c0d591$d9eaecc0$3a1607d5 AT andreas> Subject: Re: sys_errlist / errno trouble while building an application Date: Sun, 6 May 2001 17:28:35 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 06 May 2001 07:23:23.0980 (UTC) FILETIME=[6F75B0C0:01C0D5FD] try searching for sys_errlist on the cygwin archives. this is a standard porting problem. Rob ----- Original Message ----- From: "Andreas Eibach" To: Sent: Sunday, May 06, 2001 4:33 AM Subject: sys_errlist / errno trouble while building an application > Hi, > > I'm currently *trying* to build xv 3.10a, this old image viewer [Yes this > is an XFree application, and so it would actually belong to the cygwin-xfree > list, but in fact it's no XFree problem but will happen with every console > application as well. So this should only be considered an example.] > > Here's the output (shortened) > > gcc -g -ansi -pedantic -W -Wreturn-type -Wmissing-prototypes -O -I/usr /X11 > R6/include -L > R6/lib -DDOJPEG -Ijpeg -DDOTIFF -Itiff -DDOPDS -c xv.c > xv.c: In function `main': > xv.c:455: warning: comparison between signed and unsigned > xv.c: In function `openPic': > > -------------------------------------------------------------- > xv.c:2020: `sys_errlist' undeclared (first use in this function) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > xv.c:2020: (Each undeclared identifier is reported only once > xv.c:2020: for each function it appears in.) > xv.c:2377: warning: comparison between signed and unsigned > xv.c:2377: warning: comparison between signed and unsigned > xv.c:2415: warning: comparison between signed and unsigned > xv.c:2415: warning: comparison between signed and unsigned > xv.c: In function `UncompressFile': > xv.c:2714: `sys_errlist' undeclared (first use in this function) > xv.c: In function `createMainWindow': > xv.c:3203: warning: comparison between signed and unsigned > xv.c:3204: warning: comparison between signed and unsigned > xv.c:3247: warning: comparison between signed and unsigned > xv.c:3248: warning: comparison between signed and unsigned > xv.c: In function `FixAspect': > xv.c:3398: warning: comparison between signed and unsigned > xv.c:3406: warning: comparison between signed and unsigned > xv.c: In function `fixDispNames': > xv.c:3458: warning: comparison between signed and unsigned > xv.c:3465: warning: comparison between signed and unsigned > xv.c: In function `DeleteCmd': > xv.c:3633: `sys_errlist' undeclared (first use in this function) > xv.c: In function `HandleDispMode': > xv.c:3869: warning: comparison between signed and unsigned > xv.c:3869: warning: comparison between signed and unsigned > xv.c: In function `add_filelist_to_namelist': > xv.c:3908: `sys_errlist' undeclared (first use in this function) > make: *** [xv.o] Error 1 > > > As David Robinow pointed out (as posted in the thread 'oldhand > cygwinner...') it's a wise decision to NOT include ANY declarations of errno > or sys_errlist into your programs, but as you can see, "sys_errlist > undeclared" tells me that I _must_ declare it (obviously). > Well, the declarations in sys/errno.h have a very strange format: > > extern __IMPORT _CONST char * _CONST _sys_errlist[]; > extern __IMPORT int _sys_nerr; > > Last, it could maybe be useful to understand the problem if I post the line > in xv.c where errno is used: > > xv.c, Line #2019f: > > --char foostr[512]; > --sprintf (foostr, "Can't open file '%s'\n\n %s.", filename, > ERRSTR(errno)); > > I hope anyone of you can give me a hint how to solve this compile problem. > Thanks in advance, > > Andreas > > > -- > Want to unsubscribe from this list? > Check out: http://cygwin.com/ml/#unsubscribe-simple > > -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple