summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/sd-journal
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-06-30 14:32:49 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-07-01 13:42:46 +0200
commit55ce4e1bcb1d802fe6eef2aba84d9228fa66549b (patch)
tree540809b978745b73d77cfbcb6900e081a65158a8 /src/libsystemd/sd-journal
parentsd-id128: avoid an unnecessary function call in inline helper (diff)
downloadsystemd-55ce4e1bcb1d802fe6eef2aba84d9228fa66549b.tar.xz
systemd-55ce4e1bcb1d802fe6eef2aba84d9228fa66549b.zip
sd-journal: silence bogus gcc warning
In function 'sd_id128_equal', inlined from 'journal_file_verify' at ../src/libsystemd/sd-journal/journal-verify.c:1047:29: ../src/systemd/sd-id128.h:119:43: error: 'entry_boot_id.qwords[0]' may be used uninitialized [-Werror=maybe-uninitialized] 119 | return a.qwords[0] == b.qwords[0] && a.qwords[1] == b.qwords[1]; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/libsystemd/sd-journal/journal-verify.c: In function 'journal_file_verify': ../src/libsystemd/sd-journal/journal-verify.c:823:20: note: 'entry_boot_id.qwords[0]' was declared here 823 | sd_id128_t entry_boot_id; | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors entry_boot_id is only used when entry_monotonic_set has been set, and that's only done in one place where entry_boot_id is also initalized.
Diffstat (limited to 'src/libsystemd/sd-journal')
-rw-r--r--src/libsystemd/sd-journal/journal-verify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-journal/journal-verify.c b/src/libsystemd/sd-journal/journal-verify.c
index 1495450394..08b86f9758 100644
--- a/src/libsystemd/sd-journal/journal-verify.c
+++ b/src/libsystemd/sd-journal/journal-verify.c
@@ -815,7 +815,7 @@ int journal_file_verify(
uint64_t p = 0, last_epoch = 0, last_tag_realtime = 0, last_sealed_realtime = 0;
uint64_t entry_seqnum = 0, entry_monotonic = 0, entry_realtime = 0;
- sd_id128_t entry_boot_id;
+ 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;
usec_t last_usec = 0;