This patch-set fixes all the warnings reported by gcc 11. Patch 1 adds the `format` GCC attribute to ulogd_log. Patches 2-5 fix the format errors revealed by the patch 1. Patches 6-8 fix fall-through warnings. Patches 9-10 are flow-control improvements related to patch 8. Patch 11 replaces malloc+memset with calloc. Patches 12-14 fix string-truncation warnings. Patch 15 fixes a possible unaligned pointer access. Patch 16 fixes DBI deprecation warnings. Patches 17-20 fix more truncation warnings. Patch 21 adds error-checking to sqlite SQL preparation. Patches 22-26 fix more truncation and format warnings. Patches 27 removes some superfluous preprocessor macros. Changes since v1: * patch 13: stat of socket removed; * patch 15: `struct iphdr` pointer removed; * patch 27 is new. Jeremy Sowden (27): include: add format attribute to __ulogd_log declaration ulog: remove empty log-line ulog: fix order of log arguments ulog: correct log specifiers output: IPFIX: correct format-specifiers jhash: add "fall through" comments to switch cases db: add missing `break` to switch-case filter: HWHDR: replace `switch` with `if` filter: HWHDR: re-order KEY_RAW_MAC checks filter: HWHDR: remove zero-initialization of MAC type Replace malloc+memset with calloc filter: PWSNIFF: replace malloc+strncpy with strndup input: UNIXSOCK: remove stat of socket-path input: UNIXSOCK: fix possible truncation of socket path input: UNIXSOCK: prevent unaligned pointer access output: DBI: fix deprecation warnings output: DBI: fix string truncation warnings output: MYSQL: Fix string truncation warning output: PGSQL: Fix string truncation warning output: SQLITE3: Fix string truncation warnings and possible buffer overruns output: SQLITE3: catch errors creating SQL statement util: db: fix possible string truncation output: JSON: fix output of GMT offset output: JSON: fix printf truncation warnings output: JSON: optimize appending of newline to output output: JSON: fix possible truncation of socket path output: IPFIX: remove attribute macros filter/ulogd_filter_HWHDR.c | 54 ++++++++++++------------- filter/ulogd_filter_PWSNIFF.c | 18 ++++----- include/ulogd/jhash.h | 24 +++++------ include/ulogd/ulogd.h | 8 +--- input/packet/ulogd_inppkt_UNIXSOCK.c | 51 +++++++++++------------ output/dbi/ulogd_output_DBI.c | 58 ++++++++++++--------------- output/ipfix/ipfix.c | 6 +-- output/ipfix/ipfix.h | 8 ++-- output/ipfix/ulogd_output_IPFIX.c | 7 ++-- output/mysql/ulogd_output_MYSQL.c | 19 ++++----- output/pgsql/ulogd_output_PGSQL.c | 19 ++++----- output/sqlite3/ulogd_output_SQLITE3.c | 58 +++++++++++++-------------- output/ulogd_output_JSON.c | 42 ++++++++++--------- src/ulogd.c | 6 +-- util/db.c | 24 +++++------ 15 files changed, 185 insertions(+), 217 deletions(-) -- 2.33.0