]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
various: silence gcc warnings
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Apr 2021 08:37:11 +0000 (10:37 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Apr 2021 10:02:25 +0000 (12:02 +0200)
AFAICT, gcc is just being stupid in all those cases.

src/basic/efivars.c
src/home/homework-luks.c
src/libsystemd/sd-netlink/generic-netlink.c
src/shared/sleep-config.c

index 26d34bb94f8ab46a8a326f818c325aebaebaa316..2139cf3a693ddeb7da217c5144bf978287f4bbe2 100644 (file)
@@ -63,7 +63,7 @@ int efi_get_variable(
         _cleanup_free_ char *p = NULL;
         _cleanup_free_ void *buf = NULL;
         struct stat st;
-        usec_t begin;
+        usec_t begin = 0; /* Unnecessary initialization to appease gcc */
         uint32_t a;
         ssize_t n;
 
index 07d5bcfdb6136eb79fd9f6f4708f6f4bdadb74ac..543195914fb3632c7ddb603a6eeebf054cd9d58c 100644 (file)
@@ -1870,7 +1870,8 @@ int home_create_luks(
                 UserRecord **ret_home) {
 
         _cleanup_free_ char *dm_name = NULL, *dm_node = NULL, *subdir = NULL, *disk_uuid_path = NULL, *temporary_image_path = NULL;
-        uint64_t host_size, encrypted_size, partition_offset, partition_size;
+        uint64_t encrypted_size,
+                host_size = 0, partition_offset = 0, partition_size = 0; /* Unnecessary initialization to appease gcc */
         bool image_created = false, dm_activated = false, mounted = false;
         _cleanup_(user_record_unrefp) UserRecord *new_home = NULL;
         sd_id128_t partition_uuid, fs_uuid, luks_uuid, disk_uuid;
index 6760e0d348fb83003e8bd13a96bada1a18cd108d..a939d655698aa9b3ec93cc22cf39563ec8fd32ea 100644 (file)
@@ -118,7 +118,7 @@ static int lookup_id(sd_netlink *nl, sd_genl_family_t family, uint16_t *id) {
 }
 
 int sd_genl_message_new(sd_netlink *nl, sd_genl_family_t family, uint8_t cmd, sd_netlink_message **ret) {
-        uint16_t id;
+        uint16_t id = 0; /* Unnecessary initialization to appease gcc */
         int r;
 
         r = lookup_id(nl, family, &id);
index cea51482deec43476c37f4fc0b913fff59dd9dfa..37f83306dba87f8794040f1f408709e93b200869 100644 (file)
@@ -324,7 +324,7 @@ static bool location_is_resume_device(const HibernateLocation *location, dev_t s
 int find_hibernate_location(HibernateLocation **ret_hibernate_location) {
         _cleanup_fclose_ FILE *f = NULL;
         _cleanup_(hibernate_location_freep) HibernateLocation *hibernate_location = NULL;
-        dev_t sys_resume;
+        dev_t sys_resume = 0; /* Unnecessary initialization to appease gcc */
         uint64_t sys_offset = 0;
         bool resume_match = false;
         int r;