This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: Patch: Warning removal


> 	This patch was a very bad idea to install without greater
> testing.  The new prototypes in collect2.c now conflict with the
> prototypes in AIX 4.3 /usr/include/ldfcn.h.
> 
> 	There is no easy way to get this right for all versions which is
> why they were not prototyped.  Either use a prototype matching each OS or
> please revert this bad patch at your earliest convenience.
> 
> Thanks, David

Mea culpa. Had I tested on alpha-dec-osf4.0e I would have seen a prototype
mismatch on ldtbread. Only rs6000-ibm-aix4.2.0.0 of the accessible platforms
i?86-*-{sco3.2.4,uw2,uw7} and alpha-dec-osf4.0e lack the necessary prototypes
in ldfcn.h.
Kaveh's recommendation to use autoconf is wise in retrospect.

Withdrawing the patch is appropriate. If the explicit prototypes are worth
something as documentation or whatever, the following untested sketch
could work. (Will try on the next snapshot).


--- ../collect2.c	Thu Jan  4 10:23:27 2001
+++ collect2.c	Tue Jan  9 11:30:30 2001
@@ -2688,9 +2688,17 @@ scan_libraries (prog_name)
       || (HEADER (X).f_magic == 0757 && aix64_flag))
 #endif
 
+#ifdef HAVE_LDFCN_H
+#ifndef HAVE_DECL_LDCLOSE
+extern int ldclose PARAMS ((LDFILE *));
+#endif
+#ifndef HAVE_DECL_LDGETNAME
 extern char *ldgetname PARAMS ((LDFILE *, GCC_SYMENT *));
+#endif
+#ifndef HAVE_DECL_LDTBREAD
 extern int ldtbread PARAMS ((LDFILE *, long, GCC_SYMENT *));
-extern int ldclose PARAMS ((LDFILE *));
+#endif
+#endif	/* HAVE_LDFCN_H */
 
 /* COFF version to scan the name list of the loaded program for
    the symbols g++ uses for static constructors and destructors.
--- ../configure.in	Fri Dec 22 08:48:47 2000
+++ configure.in	Tue Jan  9 11:30:30 2001
@@ -437,7 +437,7 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
 		 fcntl.h unistd.h stab.h sys/file.h sys/time.h \
 		 sys/resource.h sys/param.h sys/times.h sys/stat.h \
-		 direct.h malloc.h langinfo.h iconv.h)
+		 direct.h malloc.h langinfo.h iconv.h ldfcn.h)
 
 # Check for thread headers.
 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
@@ -584,6 +584,15 @@ gcc_AC_CHECK_DECLS(getrlimit setrlimit g
 #include <sys/resource.h>
 #endif
 ])
+
+if test "$ac_cv_header_ldfcn_h" = yes; then
+  # Check for declarations on COFF platforms, ldtbread varies 
+gcc_AC_CHECK_DECLS(ldclose ldgetname ldtbread, , ,[
+#include "gansidecl.h"
+#include "system.h"
+#include <ldfcn.h>
+])
+fi
 
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
 CFLAGS="$saved_CFLAGS"

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