Silence clang missing-field-initializers warning

When libiscsi is built with clang several spurious
missing-field-initializers warnings like the following are reported:

test_async_write.c:61:45: error: missing field 'completed' initializer
[-Werror,-Wmissing-field-initializers]
	struct tests_async_write_state state = { 0 };

These appear to be due to clang being overzealous in its checking
because the code is legal C (see
https://llvm.org/bugs/show_bug.cgi?id=21689 ) but it causes compilation
to be aborted. Workaround the problem by specifying a 0 or NULL for each
structure member.
This commit is contained in:
Sitsofe Wheeler
2016-03-31 20:13:13 +01:00
parent 2bba2fedf9
commit 71879c913a
4 changed files with 4 additions and 4 deletions

View File

@@ -102,7 +102,7 @@ test_mpio_async_caw(void)
{
int i, ret;
int sd_i;
struct test_mpio_async_caw_state state = { 0 };
struct test_mpio_async_caw_state state = { 0, 0, 0 };
int blocksize = 512;
int num_ios = 1000;
uint32_t lba = 0;