[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Avoid compiler warnings
From: |
Eric Blake |
Subject: |
Avoid compiler warnings |
Date: |
Fri, 11 Aug 2006 16:42:47 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
I tried configuring m4 with its --enable-debug switch, which enables various -W
warning options, and combined it with -Werror to forcefully see the warnings.
The compilation choked when compiling libltdl. The check for AC_C_CONST is now
obsolete, but warned due to -Wshadow, which made it fail and define const to
the empty string, and led to all sorts of followon fun. And the check for how
to use nm was failing due to -Wmissing-prototypes. Yes, it's probably too
strict of an environment to sanely compile in normally, but it was easy enough
to patch. OK to apply? Should I try backporting it to 1.5.x as well?
2006-08-11 Eric Blake <address@hidden>
* libltdl/m4/libtool.m4 (lt_cv_sys_global_symbol_pipe): Work in
spite of -Wmissing-prototypes.
* libltdl/m4/ltdl.m4 (LTDL_INIT): Avoid macros marked obsolete in
latest autoconf.
* libltdl/libltdl/lt__dirent.h: Rewrite to accomodate loss of
AC_HEADER_DIRENT.
Index: libltdl/libltdl/lt__dirent.h
===================================================================
RCS file: /sources/libtool/libtool/libltdl/libltdl/lt__dirent.h,v
retrieving revision 1.3
diff -u -b -r1.3 lt__dirent.h
--- libltdl/libltdl/lt__dirent.h 17 Sep 2005 07:29:03 -0000 1.3
+++ libltdl/libltdl/lt__dirent.h 11 Aug 2006 16:38:56 -0000
@@ -1,5 +1,5 @@
/* lt__dirent.h -- internal directory entry scanning interface
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
Originally by Bob Friesenhahn <address@hidden>
NOTE: The canonical source of this file is maintained with the
@@ -40,27 +40,12 @@
#include "lt_system.h"
-#if defined(HAVE_CLOSEDIR) && defined(HAVE_OPENDIR) && defined(HAVE_READDIR)
&& defined(HAVE_DIRENT_H)
+#if defined(HAVE_DIRENT_H)
/* We have a fully operational dirent subsystem. */
# include <dirent.h>
# define D_NAMLEN(dirent) (strlen((dirent)->d_name))
-#elif !defined(__WINDOWS__)
-/* We are not on windows, so we can get the same functionality from the
- `direct' API. */
-# define dirent direct
-# define D_NAMLEN(dirent) ((dirent)->d_namlen)
-# if defined(HAVE_SYS_NDIR_H)
-# include <sys/ndir.h>
-# endif
-# if defined(HAVE_SYS_DIR_H)
-# include <sys/dir.h>
-# endif
-# if defined(HAVE_NDIR_H)
-# include <ndir.h>
-# endif
-
-#else /* __WINDOWS__ */
+#elif defined(__WINDOWS__)
/* Use some wrapper code to emulate dirent on windows.. */
# define WINDOWS_DIRENT_EMULATION 1
@@ -96,6 +81,8 @@
LT_END_C_DECLS
+#else /* !defined(__WINDOWS__)*/
+ERROR - cannot find dirent
#endif /*!defined(__WINDOWS__)*/
#endif /*!defined(LT__DIRENT_H)*/
Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /sources/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.78
diff -u -b -r1.78 libtool.m4
--- libltdl/m4/libtool.m4 3 Aug 2006 14:06:36 -0000 1.78
+++ libltdl/m4/libtool.m4 11 Aug 2006 16:38:56 -0000
@@ -3223,7 +3223,8 @@
extern "C" {
#endif
char nm_test_var;
-void nm_test_func(){}
+void nm_test_func(void);
+void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
Index: libltdl/m4/ltdl.m4
===================================================================
RCS file: /sources/libtool/libtool/libltdl/m4/ltdl.m4,v
retrieving revision 1.28
diff -u -b -r1.28 ltdl.m4
--- libltdl/m4/ltdl.m4 22 Jul 2006 04:08:46 -0000 1.28
+++ libltdl/m4/ltdl.m4 11 Aug 2006 16:38:56 -0000
@@ -240,9 +240,6 @@
# other users should call LT_WITH_LTDL instead.
AC_DEFUN([LTDL_INIT],
[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_C_CONST])dnl
-AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
@@ -288,7 +285,7 @@
[])])])
AC_SUBST([LT_CONFIG_H])
-AC_CHECK_HEADERS([memory.h unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h],
+AC_CHECK_HEADERS([memory.h unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h
dirent.h],
[], [], [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([string.h strings.h], [break], [], [AC_INCLUDES_DEFAULT])
- Avoid compiler warnings,
Eric Blake <=