various: silence gcc warnings

AFAICT, gcc is just being stupid in all those cases.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-04-01 12:02:25 +02:00
parent 1f8fb21c42
commit aff81b1851
4 changed files with 5 additions and 4 deletions
+1 -1
View 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;
+2 -1
View 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;
+1 -1
View 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);
+1 -1
View 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;