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.
This commit is contained in:
Carsten Haitzler 2021-05-26 03:36:39 +01:00
parent d6005e9df8
commit 43b41f2383
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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);