summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-05-26 03:36:39 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-05-26 03:43:31 +0100
commit43b41f2383d76a6e5eaeb7b44c531e44a8fcb92a (patch)
treeb41a3ce0e606fa7fe7e3003ae9bb2a157adf3471
parentd6005e9df8cb550a2014943729b391281e14496e (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/emile/emile_compress.c5
-rw-r--r--src/lib/emile/emile_main.c6
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,
139 Eina_Binbuf *out; 139 Eina_Binbuf *out;
140 void *expanded; 140 void *expanded;
141 141
142// this warning is wrong here so disable it
143#pragma GCC diagnostic push
144#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
142 expanded = malloc(dest_length); 145 expanded = malloc(dest_length);
143 if (!expanded) 146 if (!expanded)
144 return NULL; 147 return NULL;
145
146 out = eina_binbuf_manage_new(expanded, dest_length, EINA_FALSE); 148 out = eina_binbuf_manage_new(expanded, dest_length, EINA_FALSE);
149#pragma GCC diagnostic pop
147 if (!out) 150 if (!out)
148 goto on_error; 151 goto on_error;
149 152
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
131 unsigned int tmp_len; 131 unsigned int tmp_len;
132 unsigned int i, j, k; 132 unsigned int i, j, k;
133 133
134// this warning is wrong here so disable it
135#pragma GCC diagnostic push
136#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
134 buf = alloca(salt_len + 4); 137 buf = alloca(salt_len + 4);
135
136 step1 = eina_binbuf_manage_new(buf, salt_len + 4, EINA_TRUE); 138 step1 = eina_binbuf_manage_new(buf, salt_len + 4, EINA_TRUE);
139#pragma GCC diagnostic pop
140
137 if (!step1) 141 if (!step1)
138 return EINA_FALSE; 142 return EINA_FALSE;
139 step2 = eina_binbuf_manage_new(digest, 20, EINA_TRUE); 143 step2 = eina_binbuf_manage_new(digest, 20, EINA_TRUE);