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: <002b01c0d591$d9eaecc0$3a1607d5@andreas> From: "Andreas Eibach" To: Subject: sys_errlist / errno trouble while building an application Date: Sat, 5 May 2001 20:33:16 +0200 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.4522.1200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 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