diff --git a/configure.ac b/configure.ac index 3e0402f7..07abd4d4 100644 --- a/configure.ac +++ b/configure.ac @@ -389,6 +389,8 @@ AM_CFLAGS="$AM_CFLAGS -Wall -Wextra -Wformat=2 -Wno-format-zero-length" AM_CFLAGS="$AM_CFLAGS -Wno-deprecated-declarations -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -Wno-cast-function-type" AM_CFLAGS="$AM_CFLAGS -Wnull-dereference -Wpointer-arith" AM_CFLAGS="$AM_CFLAGS -Wimplicit-function-declaration" +AM_CFLAGS="$AM_CFLAGS -Wundef" +AM_CFLAGS="$AM_CFLAGS -Wfloat-equal -Wredundant-decls" AM_CFLAGS="$AM_CFLAGS -fstack-protector-strong -fno-common" AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2" AM_CFLAGS="$AM_CFLAGS -std=gnu99 -ggdb3" @@ -396,7 +398,7 @@ AM_CFLAGS="$AM_CFLAGS -std=gnu99 -ggdb3" # GCC-specific warnings (not supported by clang) — test each one saved_CFLAGS="$CFLAGS" for _flag in -Wlogical-op -Wduplicated-cond -Wduplicated-branches \ - -Wstringop-overflow; do + -Wstringop-overflow -Warray-bounds=2 -Walloc-zero; do AC_MSG_CHECKING([whether $CC supports $_flag]) CFLAGS="$saved_CFLAGS $_flag -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], diff --git a/src/database.c b/src/database.c index 7f9ee91e..a276e6c3 100644 --- a/src/database.c +++ b/src/database.c @@ -168,21 +168,21 @@ log_database_init(ProfAccount* account) // replaces_db_id is ID (primary key) of the original message that LMC message corrects/replaces // replaced_by_db_id is ID (primary key) of the last correcting (LMC) message for the original message const char* query = "CREATE TABLE IF NOT EXISTS `ChatLogs` (" - "`id` INTEGER PRIMARY KEY AUTOINCREMENT, " - "`from_jid` TEXT NOT NULL, " - "`to_jid` TEXT NOT NULL, " - "`from_resource` TEXT, " - "`to_resource` TEXT, " - "`message` TEXT, " - "`timestamp` TEXT, " - "`type` TEXT, " - "`stanza_id` TEXT, " - "`archive_id` TEXT, " - "`encryption` TEXT, " - "`marked_read` INTEGER, " - "`replace_id` TEXT, " - "`replaces_db_id` INTEGER, " - "`replaced_by_db_id` INTEGER)"; + "`id` INTEGER PRIMARY KEY AUTOINCREMENT, " + "`from_jid` TEXT NOT NULL, " + "`to_jid` TEXT NOT NULL, " + "`from_resource` TEXT, " + "`to_resource` TEXT, " + "`message` TEXT, " + "`timestamp` TEXT, " + "`type` TEXT, " + "`stanza_id` TEXT, " + "`archive_id` TEXT, " + "`encryption` TEXT, " + "`marked_read` INTEGER, " + "`replace_id` TEXT, " + "`replaces_db_id` INTEGER, " + "`replaced_by_db_id` INTEGER)"; if (SQLITE_OK != sqlite3_exec(g_chatlog_database, query, NULL, 0, &err_msg)) { goto out; } diff --git a/src/ui/ui.h b/src/ui/ui.h index aa8b5ea8..09b49717 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -322,7 +322,6 @@ void cons_wrap_setting(void); void cons_time_setting(void); void cons_wintitle_setting(void); void cons_notify_setting(void); -void cons_show_desktop_prefs(void); void cons_states_setting(void); void cons_outtype_setting(void); void cons_intype_setting(void); diff --git a/src/xmpp/connection.h b/src/xmpp/connection.h index 897a9fbc..012fdd6f 100644 --- a/src/xmpp/connection.h +++ b/src/xmpp/connection.h @@ -51,7 +51,6 @@ jabber_conn_status_t connection_register(const char* const altdomain, int port, void connection_set_disconnected(void); void connection_set_priority(const int priority); -void connection_set_priority(int priority); void connection_set_disco_items(GSList* items); xmpp_conn_t* connection_get_conn(void); diff --git a/src/xmpp/omemo.h b/src/xmpp/omemo.h index 9f29cb96..31021ab4 100644 --- a/src/xmpp/omemo.h +++ b/src/xmpp/omemo.h @@ -38,7 +38,6 @@ #include "xmpp/iq.h" void omemo_devicelist_subscribe(void); -void omemo_devicelist_configure_and_request(void); void omemo_devicelist_publish(GList* device_list); void omemo_devicelist_request(const char* const jid); void omemo_bundle_publish(gboolean first); diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 3eef2a9f..593b4ece 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -1948,7 +1948,7 @@ stanza_attach_priority(xmpp_ctx_t* const ctx, xmpp_stanza_t* const presence, con return; } - char pri_str[10]; + char pri_str[12]; snprintf(pri_str, sizeof(pri_str), "%d", pri); xmpp_stanza_t* priority = xmpp_stanza_new(ctx); @@ -2007,7 +2007,7 @@ stanza_attach_last_activity(xmpp_ctx_t* const ctx, xmpp_stanza_t* query = xmpp_stanza_new(ctx); xmpp_stanza_set_name(query, STANZA_NAME_QUERY); xmpp_stanza_set_ns(query, STANZA_NS_LASTACTIVITY); - char idle_str[10]; + char idle_str[12]; snprintf(idle_str, sizeof(idle_str), "%d", idle); xmpp_stanza_set_attribute(query, STANZA_ATTR_SECONDS, idle_str); xmpp_stanza_add_child(presence, query);