diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 8a19d5a937..9a0f8f9bd3 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -27,9 +27,9 @@ jobs: env: - { COMPILER: "gcc", COMPILER_VERSION: "11", LINKER: "bfd", CRYPTOLIB: "gcrypt" } - { COMPILER: "gcc", COMPILER_VERSION: "12", LINKER: "gold", CRYPTOLIB: "openssl" } - - { COMPILER: "clang", COMPILER_VERSION: "12", LINKER: "gold", CRYPTOLIB: "gcrypt" } - - { COMPILER: "clang", COMPILER_VERSION: "13", LINKER: "lld", CRYPTOLIB: "openssl" } - - { COMPILER: "clang", COMPILER_VERSION: "14", LINKER: "bfd", CRYPTOLIB: "auto" } + - { COMPILER: "clang", COMPILER_VERSION: "13", LINKER: "gold", CRYPTOLIB: "gcrypt" } + - { COMPILER: "clang", COMPILER_VERSION: "14", LINKER: "lld", CRYPTOLIB: "openssl" } + - { COMPILER: "clang", COMPILER_VERSION: "15", LINKER: "bfd", CRYPTOLIB: "auto" } env: ${{ matrix.env }} steps: - name: Repository checkout diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index 1fadaad996..ddd329c874 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -1190,7 +1190,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) { } while (rehash_next); } - assert(n_rehashed == n_entries(h)); + assert_se(n_rehashed == n_entries(h)); return 1; } diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 3ec41a32c3..98e7492811 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -931,7 +931,6 @@ log: } static int save_context(Context *context, const struct iovec_wrapper *iovw) { - unsigned count = 0; const char *unit; int r; @@ -955,7 +954,6 @@ static int save_context(Context *context, const struct iovec_wrapper *iovw) { p = startswith(iovec->iov_base, meta_field_names[i]); if (p) { context->meta[i] = p; - count++; break; } } diff --git a/src/libsystemd/sd-journal/journal-verify.c b/src/libsystemd/sd-journal/journal-verify.c index 40aff67ee8..b9f6a161ed 100644 --- a/src/libsystemd/sd-journal/journal-verify.c +++ b/src/libsystemd/sd-journal/journal-verify.c @@ -822,7 +822,7 @@ int journal_file_verify( uint64_t entry_seqnum = 0, entry_monotonic = 0, entry_realtime = 0; sd_id128_t entry_boot_id = {}; /* Unnecessary initialization to appease gcc */ bool entry_seqnum_set = false, entry_monotonic_set = false, entry_realtime_set = false, found_main_entry_array = false; - uint64_t n_weird = 0, n_objects = 0, n_entries = 0, n_data = 0, n_fields = 0, n_data_hash_tables = 0, n_field_hash_tables = 0, n_entry_arrays = 0, n_tags = 0; + uint64_t n_objects = 0, n_entries = 0, n_data = 0, n_fields = 0, n_data_hash_tables = 0, n_field_hash_tables = 0, n_entry_arrays = 0, n_tags = 0; usec_t last_usec = 0; _cleanup_close_ int data_fd = -1, entry_fd = -1, entry_array_fd = -1; _cleanup_fclose_ FILE *data_fp = NULL, *entry_fp = NULL, *entry_array_fp = NULL; @@ -1205,9 +1205,6 @@ int journal_file_verify( n_tags++; break; - - default: - n_weird++; } if (p == le64toh(f->header->tail_object_offset)) { diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index 7a07d20e0b..bd203b37dd 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -206,15 +206,13 @@ int bus_machine_method_get_addresses(sd_bus_message *message, void *userdata, sd case MACHINE_HOST: { _cleanup_free_ struct local_address *addresses = NULL; - struct local_address *a; - int n, i; + int n; n = local_addresses(NULL, 0, AF_UNSPEC, &addresses); if (n < 0) return n; - for (a = addresses, i = 0; i < n; a++, i++) { - + for (int i = 0; i < n; i++) { r = sd_bus_message_open_container(reply, 'r', "iay"); if (r < 0) return r; diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c index 076779dc0e..e36627cd57 100644 --- a/src/network/networkd-dhcp-server.c +++ b/src/network/networkd-dhcp-server.c @@ -320,7 +320,7 @@ static int dhcp4_server_set_dns_from_resolve_conf(Link *link) { _cleanup_free_ struct in_addr *addresses = NULL; _cleanup_fclose_ FILE *f = NULL; size_t n_addresses = 0; - int n = 0, r; + int r; f = fopen(PRIVATE_UPLINK_RESOLV_CONF, "re"); if (!f) { @@ -341,8 +341,6 @@ static int dhcp4_server_set_dns_from_resolve_conf(Link *link) { if (r == 0) break; - n++; - l = strstrip(line); if (IN_SET(*l, '#', ';', 0)) continue;