-W \
-Weverything \
-Wformat=2 \
+ -Wno-date-time \
-Wno-disabled-macro-expansion \
+ -Wno-format-pedantic \
-Wno-missing-field-initializers \
- -Wno-date-time \
- -Wno-padded \
- -Wno-gnu-zero-variadic-macro-arguments \
- -Wno-shorten-64-to-32 \
- -Wno-sign-conversion \
- -Wno-conversion \
- -Wno-switch-enum \
- -Wno-gnu-statement-expression \
- -Wno-extended-offsetof \
-Wno-cast-align \
- -Wno-documentation-unknown-command \
+ -Wno-conversion \
-Wno-covered-switch-default \
+ -Wno-documentation-unknown-command \
+ -Wno-extended-offsetof \
+ -Wno-gnu-statement-expression \
+ -Wno-gnu-zero-variadic-macro-arguments \
-Wno-packed \
+ -Wno-padded \
-Wno-reserved-id-macro \
- -Wno-format-pedantic \
+ -Wno-shorten-64-to-32 \
+ -Wno-sign-conversion \
+ -Wno-switch-enum \
+ -wno-gnu-empty-initializer \
$verify_ptr"
else
if test "x$GCC" = "xyes"; then
-W \
-Weverything \
-Wformat=2 \
+ -Wno-date-time \
-Wno-disabled-macro-expansion \
+ -Wno-format-pedantic \
-Wno-missing-field-initializers \
- -Wno-date-time \
- -Wno-padded \
- -Wno-gnu-zero-variadic-macro-arguments \
- -Wno-shorten-64-to-32 \
- -Wno-sign-conversion \
- -Wno-conversion \
- -Wno-switch-enum \
- -Wno-gnu-statement-expression \
- -Wno-extended-offsetof \
-Wno-cast-align \
- -Wno-documentation-unknown-command \
+ -Wno-conversion \
-Wno-covered-switch-default \
+ -Wno-documentation-unknown-command \
+ -Wno-extended-offsetof \
+ -Wno-gnu-statement-expression \
+ -Wno-gnu-zero-variadic-macro-arguments \
-Wno-packed \
+ -Wno-padded \
-Wno-reserved-id-macro \
- -Wno-format-pedantic \
+ -Wno-shorten-64-to-32 \
+ -Wno-sign-conversion \
+ -Wno-switch-enum \
+ -wno-gnu-empty-initializer \
$verify_ptr"
else
if test "x$GCC" = "xyes"; then
typedef struct ad_define_s {
struct ad_define_s *next;
size_t len;
- char name[0];
+ char name[];
} ad_define_t;
static ad_define_t *ad_define_head = NULL;
char *p, *q, *r;
char const *name;
void *symbol = NULL;
- void *handle;
+ void *handle = NULL;
/*
* Get the symbol name
while ((a < a_end) && (b < b_end)) {
unsigned long a_num, b_num;
- size_t a_len, b_len;
+ size_t a_len = 0, b_len;
int ret;
bool a_str = false;
#include <freeradius-devel/tls/base.h>
#endif
-#define CURL_NO_OLDIES 1
-
-#include <curl/curl.h>
#include <talloc.h>
static uint32_t instance_count = 0;
{ NULL }
};
-fr_table_num_sorted_t const fr_curl_sslcode_table[] = {
- {L("allow"), CURLUSESSL_TRY },
- {L("demand"), CURLUSESSL_ALL },
- {L("never"), CURLUSESSL_NONE },
+static fr_table_num_sorted_t const fr_curl_sslcode_table[] = {
+ {L("allow"), CURLUSESSL_TRY },
+ {L("demand"), CURLUSESSL_ALL },
+ {L("never"), CURLUSESSL_NONE },
};
static size_t fr_curl_sslcode_table_len = NUM_ELEMENTS(fr_curl_sslcode_table);
#include <freeradius-devel/unlang/base.h>
#include <freeradius-devel/util/syserror.h>
-#define CURL_NO_OLDIES 1
-
-#include <curl/curl.h>
-#include <talloc.h>
-
/*
* CURL headers do:
*
void *chunk; //!< To pass to free. The non-aligned address.
- alignas(CACHE_LINE_SIZE) fr_atomic_queue_entry_t entry[0]; //!< The entry array, also aligned
+ alignas(CACHE_LINE_SIZE) fr_atomic_queue_entry_t entry[]; //!< The entry array, also aligned
///< to ensure it's not in the same cache
///< line as tail and size.
};
/** Attr ref types
*/
-fr_table_num_ordered_t const attr_table[] = {
+static r_table_num_ordered_t const attr_table[] = {
{ L("normal"), TMPL_ATTR_TYPE_NORMAL },
{ L("unknown"), TMPL_ATTR_TYPE_UNKNOWN },
{ L("unresolved"), TMPL_ATTR_TYPE_UNRESOLVED }
state->ptr = p;
}
-static void unlang_tmpl_exec_timeout(UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *uctx)
+static void unlang_tmpl_exec_timeout(
+#ifndef __linux__
+ UNUSED
+#endif
+ fr_event_list_t *el, UNUSED fr_time_t now, void *uctx)
{
request_t *request = uctx;
unlang_stack_t *stack = request->stack;
uint8_t ext[FR_DICT_ENUM_EXT_MAX]; //!< Extensions to the dictionary attribute.
- fr_dict_attr_t const *child_struct[0]; //!< for key fields
+ fr_dict_attr_t const *child_struct[]; //!< for key fields
} fr_dict_enum_t CC_HINT(aligned(FR_EXT_ALIGNMENT));
/** Private enterprise
*
*/
typedef struct {
- fr_dict_attr_t const *da_stack[0]; //!< Stack of dictionary attributes
+ bool unused; //!< Zero length arrays are apparently GNU extensions
+ ///< and we're not allowed to have structs with a
+ ///< single variable array as its member.
+ ///< We'll likely want to store something else here
+ ///< at some point, so we just have a dummy field to
+ ///< avoid changing all the code.
+ fr_dict_attr_t const *da_stack[]; //!< Stack of dictionary attributes
} fr_dict_attr_ext_da_stack_t;
/** Attribute extension - Holds enumeration values
return (size_t)slen; \
static inline size_t fr_sbuff_out_abstrncpy(TALLOC_CTX *ctx, char **out, fr_sbuff_t *in, size_t len)
-SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy, in, len);
+SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy, in, len)
static inline size_t fr_sbuff_out_abstrncpy_exact(TALLOC_CTX *ctx, char **out, fr_sbuff_t *in, size_t len)
-SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy_exact, in, len);
+SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy_exact, in, len)
static inline size_t fr_sbuff_out_abstrncpy_allowed(TALLOC_CTX *ctx, char **out, fr_sbuff_t *in, size_t len,
bool const allowed[static UINT8_MAX + 1])
-SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy_allowed, in, len, allowed);
+SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy_allowed, in, len, allowed)
static inline size_t fr_sbuff_out_abstrncpy_until(TALLOC_CTX *ctx, char **out, fr_sbuff_t *in, size_t len,
fr_sbuff_term_t const *tt,
fr_sbuff_unescape_rules_t const *u_rules)
-SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy_until, in, len, tt, u_rules);
+SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_bstrncpy_until, in, len, tt, u_rules)
static inline size_t fr_sbuff_out_aunescape_until(TALLOC_CTX *ctx, char **out, fr_sbuff_t *in, size_t len,
fr_sbuff_term_t const *tt,
fr_sbuff_unescape_rules_t const *u_rules)
-SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_unescape_until, in, len, tt, u_rules);
+SBUFF_OUT_TALLOC_FUNC_DEF(fr_sbuff_out_unescape_until, in, len, tt, u_rules)
/** @} */
/** @name Look for a token in a particular format, parse it, and write it to the output pointer
size_t fr_value_substr_unescape(fr_sbuff_t *out, fr_sbuff_t *in, size_t inlen, char quote);
static inline size_t fr_value_str_aunescape(TALLOC_CTX *ctx, char **out, fr_sbuff_t *in, size_t inlen, char quote)
-SBUFF_OUT_TALLOC_FUNC_DEF(fr_value_str_unescape, in, inlen, quote);
+SBUFF_OUT_TALLOC_FUNC_DEF(fr_value_str_unescape, in, inlen, quote)
static inline size_t fr_value_substr_aunescape(TALLOC_CTX *ctx, char **out, fr_sbuff_t *in, size_t inlen, char quote)
-SBUFF_OUT_TALLOC_FUNC_DEF(fr_value_substr_unescape, in, inlen, quote);
+SBUFF_OUT_TALLOC_FUNC_DEF(fr_value_substr_unescape, in, inlen, quote)
int fr_value_box_hton(fr_value_box_t *dst, fr_value_box_t const *src);
typedef struct {
uint32_t header;
size_t client_id_len;
- uint8_t client_id[0];
+ uint8_t client_id[];
} proto_dhcpv6_track_t;
* Done doing EAP proxy stuff.
*/
request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP;
- if (!fr_cond_assert(eap_session->inst)) return 0;
+ if (!fr_cond_assert(eap_session->inst)) RETURN_MODULE_FAIL;
eap_mschapv2_compose(eap_session->inst, request, eap_session, response);
data->code = FR_EAP_MSCHAPV2_SUCCESS;
uint8_t *p;
size_t length;
- if (!fr_cond_assert(eap_session->inst)) return 0;
+ if (!fr_cond_assert(eap_session->inst)) RETURN_MODULE_FAIL;
/*
* Sanity check the response.
*/
if (eap_tls_success(request, eap_session,
keying_prf_label, sizeof(keying_prf_label) - 1,
- NULL, 0) < 0) return 0;
+ NULL, 0) < 0) RETURN_MODULE_RCODE(rcode);
}
break;
uint8_t exch, *in, *ptr, msk[MSK_EMSK_LEN], emsk[MSK_EMSK_LEN];
uint8_t peer_confirm[SHA256_DIGEST_LENGTH];
- if (((eap_round = eap_session->this_round) == NULL) || !inst) return 0;
+ if (((eap_round = eap_session->this_round) == NULL) || !inst) RETURN_MODULE_FAIL;
session = talloc_get_type_abort(eap_session->opaque, pwd_session_t);
response = eap_session->this_round->response;
*/
if (EAP_PWD_GET_MORE_BIT(hdr)) {
if (!session->in) {
- RDEBUG2("Unexpected fragment.");
- return 0;
+ RDEBUG2("Unexpected fragment");
+ RETURN_MODULE_INVALID;
}
if ((session->in_pos + in_len) > session->in_len) {
{ NULL }
};
-fr_value_box_t const *enum_acct_status_type_start;
-fr_value_box_t const *enum_acct_status_type_interim_update;
-fr_value_box_t const *enum_acct_status_type_stop;
-fr_value_box_t const *enum_acct_status_type_on;
-fr_value_box_t const *enum_acct_status_type_off;
+static fr_value_box_t const *enum_acct_status_type_start;
+static fr_value_box_t const *enum_acct_status_type_interim_update;
+static fr_value_box_t const *enum_acct_status_type_stop;
+static fr_value_box_t const *enum_acct_status_type_on;
+static fr_value_box_t const *enum_acct_status_type_off;
extern fr_dict_enum_autoload_t rlm_redis_ippool_dict_enum[];
fr_dict_enum_autoload_t rlm_redis_ippool_dict_enum[] = {
#include <freeradius-devel/server/pairmove.h>
#include <freeradius-devel/server/pool.h>
-#define CURL_NO_OLDIES 1
-
-#include <curl/curl.h>
-
/*
* The common JSON library (also tells us if we have json-c)
*/
/*
* Used to ensure that only strings are being set to the tmpl_t ** output
*/
-static int cf_table_parse_tmpl(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent,
- CONF_ITEM *ci, CONF_PARSER const *rule)
+static int cf_table_parse_tmpl(TALLOC_CTX *ctx, void *out, UNUSED void *parent,
+ CONF_ITEM *ci, CONF_PARSER const *rule)
{
int ret = 0;
ssize_t slen;
/*
* Generates a curl_slist of header elements header elements
*/
-static int header_source(rlm_smtp_thread_t *t, fr_mail_ctx *uctx, UNUSED rlm_smtp_t const *inst)
+static int header_source(rlm_smtp_thread_t *t, fr_mail_ctx *uctx, rlm_smtp_t const *inst)
{
fr_sbuff_t time_out;
char const *to = "TO: ";
char const *cc = "CC: ";
- request_t *request = uctx->request;
+ request_t *request = uctx->request;
fr_sbuff_t conf_buffer;
fr_sbuff_uctx_talloc_t conf_ctx;
- map_t *conf_map;
+ map_t *conf_map;
char *expanded_rhs;
uint8_t port_len;
uint8_t rem_addr_len;
uint8_t data_len;
- uint8_t body[0];
+ uint8_t body[];
} fr_tacacs_packet_authen_start_hdr_t;
typedef enum {
fr_tacacs_authen_reply_flags_t flags:8;
uint16_t server_msg_len;
uint16_t data_len;
- uint8_t body[0];
+ uint8_t body[];
} fr_tacacs_packet_authen_reply_hdr_t;
typedef enum {
uint16_t user_msg_len;
uint16_t data_len;
fr_tacacs_authen_cont_flags_t flags:8;
- uint8_t body[0];
+ uint8_t body[];
} fr_tacacs_packet_authen_cont_hdr_t;
typedef enum {
uint8_t port_len;
uint8_t rem_addr_len;
uint8_t arg_cnt;
- uint8_t body[0];
+ uint8_t body[];
} fr_tacacs_packet_author_req_hdr_t;
typedef enum {
uint8_t arg_cnt;
uint16_t server_msg_len;
uint16_t data_len;
- uint8_t body[0];
+ uint8_t body[];
} fr_tacacs_packet_author_res_hdr_t;
typedef enum {
uint8_t port_len;
uint8_t rem_addr_len;
uint8_t arg_cnt;
- uint8_t body[0];
+ uint8_t body[];
} fr_tacacs_packet_acct_req_hdr_t;
typedef enum {
uint16_t server_msg_len;
uint16_t data_len;
fr_tacacs_acct_reply_status_t status:8;
- uint8_t body[0];
+ uint8_t body[];
} fr_tacacs_packet_acct_reply_hdr_t;
typedef struct CC_HINT(__packed__) {