compilation of statist under cygwin
Bernhard Reiter
bernhard at intevation.de
Mon Mar 29 13:26:21 CEST 2004
On Mon, Mar 29, 2004 at 01:17:12PM +0200, Bernhard Reiter wrote:
> On Mon, Mar 29, 2004 at 12:43:33PM +0200, sfronzek at gmx.net wrote:
> > thanks for your replies. With your suggestions, I managed to compile
> > statist;
>
> > however, about 200 warnings were issued similar to
> > "plot.c:434: warning: passing arg 1 of `out_err' makes pointer from integer
> > without a cast"
>
> Arg.
> Seems like there is an errno name clash.
> Try shifting the #include <errno.h> line
> directly in front of
> extern int errno;
> in statist.h
That is not enough, try the following patch against
a fresh 1.0.1.
-------------- next part --------------
Patch to resolve errno name clash issues.
bernhard at intevation.de
===================================================================
RCS file: /statistrepository/statist/CHANGES,v
retrieving revision 1.3
diff -u -r1.3 CHANGES
--- CHANGES 13 Jun 2003 13:40:35 -0000 1.3
+++ CHANGES 29 Mar 2004 11:23:49 -0000
@@ -1,4 +1,7 @@
Changes up to
+ * Resolved name clash with our_err errno,
+ discovered by Stefan Fronzek trying to compile on Cygwin.
+
* added hint for compilation with MinGW (Thanks to Andreas Beyer).
Changes up to v1.0.1: Bernhard Reiter <bernhard at intevation.de>
Index: src/statist.c
===================================================================
RCS file: /statistrepository/statist/src/statist.c,v
retrieving revision 1.6
diff -u -r1.6 statist.c
--- src/statist.c 15 Nov 2001 20:28:55 -0000 1.6
+++ src/statist.c 29 Mar 2004 11:23:49 -0000
@@ -293,13 +293,12 @@
-void out_err(int errno, char *modulname, int lno, char *fmt, ...) {
+void out_err(int errn, char *modulname, int lno, char *fmt, ...) {
va_list argptr;
- int error;
char where[128];
va_start(argptr, fmt);
- switch (errno) {
+ switch (errn) {
case WAR: strcpy(line,
_("> statist-warning ",
"> statist-Warnung ") );
@@ -322,7 +321,6 @@
break;
}
- error = errno;
if (lno != 0) {
sprintf(where,
_("(Modul %15s, line %i):\n ",
@@ -340,12 +338,12 @@
strncat(line, "\a\n\n", 254-strlen(line));
}
vfprintf(stderr, line, argptr);
- if ( ((errno==MAT) || (errno==MWA)) && (log_set) ) {
+ if ( ((errn==MAT) || (errn==MWA)) && (log_set) ) {
vfprintf(logfile, line, argptr);
}
va_end(argptr);
- if (error == FAT) {
+ if (errn == FAT) {
finish();
exit(1);
}
Index: src/statist.h
===================================================================
RCS file: /statistrepository/statist/src/statist.h,v
retrieving revision 1.12
diff -u -r1.12 statist.h
--- src/statist.h 13 Jun 2003 13:40:36 -0000 1.12
+++ src/statist.h 29 Mar 2004 11:23:49 -0000
@@ -109,9 +109,9 @@
#ifdef SUNOS
extern char *sys_errlist[];
-#define STRERROR(errno) sys_errlist[errno]
+#define STRERROR(errn) sys_errlist[errn]
#else
-#define STRERROR(errno) strerror(errno)
+#define STRERROR(errn) strerror(errn)
#endif
#ifdef DEBUG
@@ -240,6 +240,7 @@
} SORTREC;
+#include <errno.h>
extern int errno;
extern void mywait();
extern BOOLEAN myexist(char *name);
@@ -252,7 +253,7 @@
#endif
extern void out_d(char *fmt, ...);
extern void out_r(char *fmt, ...);
-extern void out_err(int errno, char *modul, int lno, char *fmt, ...);
+extern void out_err(int errn, char *modul, int lno, char *fmt, ...);
extern void print_histo(REAL x[], int y[], int n);
extern void finish();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/statist-list/attachments/20040329/8fd8b88c/attachment.bin
More information about the Statist-list
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)