From ba7784364a0e01bf3f8baab02306cec004b436a6 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Sun, 21 Aug 2016 20:37:37 +0200 Subject: Fix warnings from compiler option '-Wredundant-decls' Signed-off-by: Thomas Zimmermann --- configure.ac | 7 ++++++- dbus/dbus-marshal-basic.h | 1 - dbus/dbus-pending-call-internal.h | 2 -- dbus/dbus-spawn.c | 2 ++ dbus/dbus-sysdeps-win.h | 2 -- dbus/dbus-sysdeps.h | 3 --- tools/dbus-update-activation-environment.c | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index bcaeba6..250492a 100644 --- a/configure.ac +++ b/configure.ac @@ -501,6 +501,12 @@ case $host_os in ;; esac +## The variable 'environ' is standardized by POSIX, but usually not +## declared in the system headers. Only GNU systems declared it, so +## we test this here to avoid duplicated declarations. +AC_CHECK_DECLS([environ]) + + dnl ********************************** dnl *** va_copy checks (from GLib) *** dnl ********************************** @@ -1357,7 +1363,6 @@ dnl TODO: The compiler flags below disable warnings that the dnl compiler emits while building D-Bus. Fix the source dnl code and remove these flags. DISABLE_WARNINGS="$DISABLE_WARNINGS - -Wno-redundant-decls -Wno-suggest-attribute=format -Wno-suggest-attribute=noreturn -Wno-shadow diff --git a/dbus/dbus-marshal-basic.h b/dbus/dbus-marshal-basic.h index 68ff348..0c4e411 100644 --- a/dbus/dbus-marshal-basic.h +++ b/dbus/dbus-marshal-basic.h @@ -214,7 +214,6 @@ dbus_uint32_t _dbus_marshal_read_uint32 (const DBusString *str, int byte_order, int *new_pos); int _dbus_type_get_alignment (int typecode); -int _dbus_type_get_alignment (int typecode); DBUS_PRIVATE_EXPORT const char* _dbus_type_to_string (int typecode); diff --git a/dbus/dbus-pending-call-internal.h b/dbus/dbus-pending-call-internal.h index 393e660..a6d7fba 100644 --- a/dbus/dbus-pending-call-internal.h +++ b/dbus/dbus-pending-call-internal.h @@ -46,8 +46,6 @@ void _dbus_pending_call_set_reply_unlocked (DBusPendingCal DBusMessage *message); void _dbus_pending_call_queue_timeout_error_unlocked (DBusPendingCall *pending, DBusConnection *connection); -void _dbus_pending_call_set_reply_serial_unlocked (DBusPendingCall *pending, - dbus_uint32_t serial); dbus_bool_t _dbus_pending_call_set_timeout_error_unlocked (DBusPendingCall *pending, DBusMessage *message, dbus_uint32_t serial); diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c index df6eafd..c6e4e37 100644 --- a/dbus/dbus-spawn.c +++ b/dbus/dbus-spawn.c @@ -45,7 +45,9 @@ #include #endif +#if !HAVE_DECL_ENVIRON extern char **environ; +#endif /** * @addtogroup DBusInternalsUtils diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h index 0b5d8f0..b8861a1 100644 --- a/dbus/dbus-sysdeps-win.h +++ b/dbus/dbus-sysdeps-win.h @@ -82,8 +82,6 @@ _dbus_win_sid_to_name_and_domain (dbus_uid_t uid, wchar_t **wdomain, DBusError *error); -dbus_bool_t _dbus_file_exists (const char *filename); - DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_get_install_root (DBusString *str); diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index a2dac6c..3603093 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -666,9 +666,6 @@ dbus_pid_t _dbus_getpid (void); DBUS_PRIVATE_EXPORT dbus_uid_t _dbus_getuid (void); -dbus_bool_t _dbus_change_to_daemon_user (const char *user, - DBusError *error); - DBUS_PRIVATE_EXPORT void _dbus_flush_caches (void); diff --git a/tools/dbus-update-activation-environment.c b/tools/dbus-update-activation-environment.c index 160ac5d..3d5629d 100644 --- a/tools/dbus-update-activation-environment.c +++ b/tools/dbus-update-activation-environment.c @@ -62,7 +62,7 @@ #ifdef DBUS_WIN /* The Windows C runtime uses a different name */ #define environ _environ -#else +#elif !HAVE_DECL_ENVIRON /* apparently this is the portable way to get the entire environment... * GNU platforms also put it in unistd.h but that's not portable */ extern char **environ; -- 2.7.4