From: Arran Cudbard-Bell Date: Mon, 22 Dec 2014 21:58:14 +0000 (-0400) Subject: GCC fixes X-Git-Tag: release_3_0_7~413 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2ea6a167b7c8581e6191b59e5e4dee071795d1b;p=thirdparty%2Ffreeradius-server.git GCC fixes --- diff --git a/src/lib/radius.c b/src/lib/radius.c index 641ce32eaac..63265cb3eb0 100644 --- a/src/lib/radius.c +++ b/src/lib/radius.c @@ -663,10 +663,6 @@ static void make_tunnel_passwd(uint8_t *output, ssize_t *outlen, memcpy(output, passwd, len + 2); } -extern int const fr_attr_max_tlv; -extern int const fr_attr_shift[]; -extern int const fr_attr_mask[]; - static int do_next_tlv(VALUE_PAIR const *vp, VALUE_PAIR const *next, int nest) { unsigned int tlv1, tlv2; diff --git a/src/main/command.c b/src/main/command.c index d09ded8cfbb..6847c197641 100644 --- a/src/main/command.c +++ b/src/main/command.c @@ -348,8 +348,6 @@ static int command_terminate(UNUSED rad_listen_t *listener, return 1; /* success */ } -extern time_t fr_start_time; - static int command_uptime(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { diff --git a/src/main/connection.c b/src/main/connection.c index adc8b61f231..6f6d69cf4ac 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -33,8 +33,6 @@ typedef struct fr_connection fr_connection_t; static int fr_connection_pool_check(fr_connection_pool_t *pool); -extern bool check_config; - #ifndef NDEBUG #ifdef HAVE_PTHREAD_H /* #define PTHREAD_DEBUG (1) */ diff --git a/src/main/detail.c b/src/main/detail.c index fe93061746e..d5dbee37b4e 100644 --- a/src/main/detail.c +++ b/src/main/detail.c @@ -41,8 +41,6 @@ RCSID("$Id$") #ifdef WITH_DETAIL -extern bool check_config; - #define USEC (1000000) static FR_NAME_NUMBER state_names[] = { diff --git a/src/main/listen.c b/src/main/listen.c index f197c8d6ac7..94e284fab60 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -72,15 +72,9 @@ static int command_tcp_send(rad_listen_t *listener, REQUEST *request); static int command_write_magic(int newfd, listen_socket_t *sock); #endif -#ifdef WITH_TCP -/* - * We want to avoid opening a UDP proxy listener - * when all of the home servers are TCP. - */ -extern bool home_servers_udp; -#endif - -static fr_protocol_t master_listen[RAD_LISTEN_MAX]; +static int last_listener = RAD_LISTEN_MAX; +#define MAX_LISTENER (256) +static fr_protocol_t master_listen[MAX_LISTENER]; /* * Xlat for %{listen:foo} @@ -867,8 +861,6 @@ int common_socket_print(rad_listen_t const *this, char *buffer, size_t bufsize) return 1; } -extern bool check_config; /* radiusd.c */ - static CONF_PARSER performance_config[] = { { "skip_duplicate_checks", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rad_listen_t, nodup), NULL }, diff --git a/src/main/mainconfig.c b/src/main/mainconfig.c index 504234cf4e7..c8dcef8af60 100644 --- a/src/main/mainconfig.c +++ b/src/main/mainconfig.c @@ -52,7 +52,6 @@ RCSID("$Id$") struct main_config_t main_config; extern fr_cond_t *debug_condition; fr_cond_t *debug_condition; -extern bool log_dates_utc; typedef struct cached_config_t { struct cached_config_t *next; diff --git a/src/main/modules.c b/src/main/modules.c index c32ed45d47d..24d3b99b97c 100644 --- a/src/main/modules.c +++ b/src/main/modules.c @@ -30,8 +30,6 @@ RCSID("$Id$") #include #include -extern bool check_config; - typedef struct indexed_modcallable { rlm_components_t comp; int idx; diff --git a/src/main/process.c b/src/main/process.c index de509b85f35..9177a9bb0e0 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -45,7 +45,6 @@ RCSID("$Id$") #endif extern pid_t radius_pid; -extern bool check_config; extern fr_cond_t *debug_condition; static bool spawn_flag = false; diff --git a/src/main/radattr.c b/src/main/radattr.c index 4d49f20cef1..a1912a264f0 100644 --- a/src/main/radattr.c +++ b/src/main/radattr.c @@ -39,7 +39,8 @@ typedef struct REQUEST REQUEST; #include #include -static log_lvl_t debug_flag = 0; +extern log_lvl_t debug_flag; +log_lvl_t debug_flag = 0; /********************************************************************** * Hacks for xlat diff --git a/src/main/realms.c b/src/main/realms.c index 00892fad3ff..7e450c85b91 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -24,6 +24,7 @@ RCSID("$Id$") #include +#include #include #include @@ -1202,8 +1203,12 @@ static int old_server_add(realm_config_t *rc, CONF_SECTION *cs, cf_log_err_cs(cs, "Inconsistent ldflag for server pool \"%s\"", name); return 0; } - - if (pool->server_type != type) { + + /* + * GCC throws signed comparison warning here without the cast + * very strange... + */ + if ((home_type_t) pool->server_type != type) { cf_log_err_cs(cs, "Inconsistent home server type for server pool \"%s\"", name); return 0; } diff --git a/src/modules/proto_dhcp/dhcpd.c b/src/modules/proto_dhcp/dhcpd.c index 82ec0946182..c2d54c80baf 100644 --- a/src/modules/proto_dhcp/dhcpd.c +++ b/src/modules/proto_dhcp/dhcpd.c @@ -56,8 +56,6 @@ #include #endif -extern bool check_config; /* @todo globals are bad, m'kay? */ - /* * Same contents as listen_socket_t. */ diff --git a/src/modules/rlm_rest/rest.c b/src/modules/rlm_rest/rest.c index 84277ea48a6..62b21b46881 100644 --- a/src/modules/rlm_rest/rest.c +++ b/src/modules/rlm_rest/rest.c @@ -93,6 +93,7 @@ const http_body_type_t http_body_type_supported[HTTP_BODY_NUM_ENTRIES] = { * * #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) */ +DIAG_OFF(pragmas) DIAG_OFF(disabled-macro-expansion) #define SET_OPTION(_x, _y)\ do {\