MT#55283 improvements for clang

Change-Id: I7b817c94f34333e1e95199dce9619a1570de7964
pull/2079/head
Richard Fuchs 2 months ago
parent cb3edfb996
commit 1f7d9e5bc9

@ -758,8 +758,8 @@ static const char *dtmf_inject_pcm(struct call_media *media, struct call_media *
.rtp = &rtp,
.ssrc_in = ssrc_in,
.ssrc_out = ssrc_out,
.raw = { (void *) &tep, sizeof(tep) },
.payload = { (void *) &tep, sizeof(tep) },
.raw = { (void *) &tep, sizeof(tep), 0 },
.payload = { (void *) &tep, sizeof(tep), 0 },
.sink = { .sink = sink_ps },
};

@ -892,7 +892,7 @@ static void options(int *argc, char ***argv, charp_ht templates) {
{ "ng-client-timeout",0,0,G_OPTION_ARG_INT, &rtpe_config.ng_client_timeout,"Timeout in milliseconds for outgoing NG requests","INT"},
{ "ng-client-retries",0,0,G_OPTION_ARG_INT, &rtpe_config.ng_client_retries,"How often to retry a timed-out NG request","INT"},
{ NULL, }
{ 0 }
};
struct ifaddrs *ifas;

@ -274,7 +274,7 @@ void config_load_ext(int *argc, char ***argv, GOptionEntry *app_entries, const c
{ "codec-chain-opus-application",0,0,G_OPTION_ARG_STRING,&opus_application, "Opus application", "default|VoIP|audio|low-delay" },
{ "codec-chain-opus-complexity",0,0,G_OPTION_ARG_INT, &rtpe_common_config_ptr->codec_chain_opus_complexity,"Opus encoding complexity (0..10)","INT" },
#endif
{ NULL, }
{ 0 }
};
#undef ll

@ -513,7 +513,7 @@ INLINE gboolean int64_eq(const uint64_t *a, const uint64_t *b) {
/*** TAINT FUNCTIONS ***/
#if HAS_ATTR(__error__)
#if HAS_ATTR(__error__) && !defined(__clang__)
/* This is not supported in clang, and on gcc it might become inert if the
* symbol gets remapped to a builtin or stack protected function, but it
* otherwise gives better diagnostics. */

@ -28,10 +28,10 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
/* unused members to store the contained types */ \
type_name __ht; \
}; \
static inline type_name type_name##_null(void) { \
__attribute__((unused)) static inline type_name type_name##_null(void) { \
return (type_name) { NULL }; \
} \
static inline void type_name##_destroy_ptr(type_name *h) { \
__attribute__((unused)) static inline void type_name##_destroy_ptr(type_name *h) { \
if (h->ht) \
g_hash_table_destroy(h->ht); \
h->ht = NULL; \
@ -225,14 +225,14 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
"tail offset mismatch"); \
static_assert(G_STRUCT_OFFSET(GQueue, length) == G_STRUCT_OFFSET(type_name##_q, length), \
"length offset mismatch"); \
static inline type_name##_q *type_name##_q_new(void) { \
__attribute__((unused)) static inline type_name##_q *type_name##_q_new(void) { \
GQueue *q = g_queue_new(); \
return (type_name##_q *) q; \
} \
static inline void type_name##_q_clear(type_name##_q *q) { \
__attribute__((unused)) static inline void type_name##_q_clear(type_name##_q *q) { \
g_queue_clear(&q->q); \
} \
static inline void type_name##_q_free(type_name##_q *q) { \
__attribute__((unused)) static inline void type_name##_q_free(type_name##_q *q) { \
g_queue_free(&q->q); \
}
@ -461,18 +461,18 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
"pdata offset mismatch"); \
static_assert(G_STRUCT_OFFSET(GPtrArray, len) == G_STRUCT_OFFSET(type_name, len), \
"len offset mismatch"); \
static inline type_name *type_name##_new_sized(unsigned int len) { \
__attribute__((unused)) static inline type_name *type_name##_new_sized(unsigned int len) { \
void (*func)(contained_type *) = free_func; \
return (type_name *) g_ptr_array_new_full(len, (GDestroyNotify) func); \
} \
static inline type_name *type_name##_new(void) { \
__attribute__((unused)) static inline type_name *type_name##_new(void) { \
return type_name##_new_sized(0); \
} \
static inline void type_name##_destroy(type_name *A) { \
__attribute__((unused)) static inline void type_name##_destroy(type_name *A) { \
if (A) \
g_ptr_array_free(&(A)->a, TRUE); \
} \
static inline void type_name##_destroy_ptr(type_name **A) { \
__attribute__((unused)) static inline void type_name##_destroy_ptr(type_name **A) { \
if (*A) \
g_ptr_array_free(&(*A)->a, TRUE); \
*A = NULL; \

@ -196,12 +196,13 @@ for my $section (@sections) {
print "#pragma GCC diagnostic push\n";
print "#pragma GCC diagnostic ignored \"-Wmissing-field-initializers\"\n";
print "#pragma GCC diagnostic ignored \"-Wshadow=global\"\n";
print "#pragma GCC diagnostic ignored \"-Wshadow\"\n";
print $hash_func_code;
print "#pragma GCC diagnostic pop\n";
# add convenience function
print <<END;
#include "str.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored \"-Wunused-function\"
static int __csh_lookup_$num(const str *s) {
if (!s->s)
@ -221,6 +222,7 @@ for my $section (@sections) {
}
print <<END;
};
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored \"-Wunused-function\"
static int __csh_lookup_section(unsigned int n, const str *s) {
if (n >= G_N_ELEMENTS(__csh_lookup_funcs))

Loading…
Cancel
Save