From 43b41f2383d76a6e5eaeb7b44c531e44a8fcb92a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 26 May 2021 03:36:39 +0100 Subject: [PATCH] emile - disable warnings when they are wrong ifor new buffers emile in these 2 cases allocates an empty uninitilised buffer that will then be filled - gcc thinks we're passing uninit data to a func - which is right but intended as it is later filled. disable this warning for these segments of code. --- src/lib/emile/emile_compress.c | 5 ++++- src/lib/emile/emile_main.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/emile/emile_compress.c b/src/lib/emile/emile_compress.c index 783e00b1ab..b755717454 100644 --- a/src/lib/emile/emile_compress.c +++ b/src/lib/emile/emile_compress.c @@ -139,11 +139,14 @@ emile_decompress(const Eina_Binbuf *data, Eina_Binbuf *out; void *expanded; +// this warning is wrong here so disable it +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" expanded = malloc(dest_length); if (!expanded) return NULL; - out = eina_binbuf_manage_new(expanded, dest_length, EINA_FALSE); +#pragma GCC diagnostic pop if (!out) goto on_error; diff --git a/src/lib/emile/emile_main.c b/src/lib/emile/emile_main.c index 8591f0e8bc..ce20df757d 100644 --- a/src/lib/emile/emile_main.c +++ b/src/lib/emile/emile_main.c @@ -131,9 +131,13 @@ emile_pbkdf2_sha1(const char *key, unsigned int key_len, const unsigned char *sa unsigned int tmp_len; unsigned int i, j, k; +// this warning is wrong here so disable it +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" buf = alloca(salt_len + 4); - step1 = eina_binbuf_manage_new(buf, salt_len + 4, EINA_TRUE); +#pragma GCC diagnostic pop + if (!step1) return EINA_FALSE; step2 = eina_binbuf_manage_new(digest, 20, EINA_TRUE);