This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
warnings about auto importing sys_errlist / sys_nerr on Cygwin
- From: Jay <jay dot krell at cornell dot edu>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 2 Sep 2008 08:58:50 +0000
- Subject: warnings about auto importing sys_errlist / sys_nerr on Cygwin
- References: <1220212181.27379.ezmlm@gcc.gnu.org>
To fix a bunch of these:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: warning: au
to-importing has been activated without --enable-auto-import specified on the co
mmand line.
This should work unless it involves constant data structures referencing symbols
from auto-imported DLLs.Info: resolving _sys_nerr by linking to __imp__sys_nerr
(auto-import)
Info: resolving _sys_errlist by linking to __imp__sys_errlist (auto-import)
libtool: link: creating ld-new.exe
$ diff -u /src/gcc.orig/libiberty/strerror.c /src/gcc/libiberty/strerror.c
--- /src/gcc.orig/libiberty/strerror.c 2005-03-27 18:28:01.000000000 -0700
+++ /src/gcc/libiberty/strerror.c 2008-09-02 01:56:27.724250000 -0700
@@ -4,6 +4,7 @@
#include "config.h"
+#ifndef __CYGWIN__
#ifdef HAVE_SYS_ERRLIST
/* Note that errno.h (not sure what OS) or stdio.h (BSD 4.4, at least)
might declare sys_errlist in a way that the compiler might consider
@@ -13,6 +14,7 @@
#define sys_nerr sys_nerr__
#define sys_errlist sys_errlist__
#endif
+#endif
#include "ansidecl.h"
#include "libiberty.h"
@@ -20,10 +22,12 @@
#include
#include
+#ifndef __CYGWIN__
#ifdef HAVE_SYS_ERRLIST
#undef sys_nerr
#undef sys_errlist
#endif
+#endif
/* Routines imported from standard C runtime libraries. */
@@ -460,6 +464,7 @@
same name, it differs from other implementations in that it is dynamically
initialized rather than statically initialized. */
+#ifndef __CYGWIN__
#ifndef HAVE_SYS_ERRLIST
#define sys_nerr sys_nerr__
@@ -473,6 +478,7 @@
extern char *sys_errlist[];
#endif
+#endif
/*
Thanks,
- Jay