This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

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


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