These two warnings test-ieee754-h.c:39:4: warning: missing initializer for field 'frac_lo' of 'const struct <anonymous>' [-Wmissing-field-initializers] test-ieee754-h.c:40:4: warning: missing initializer for field 'frac_lo' of 'const struct <anonymous>' [-Wmissing-field-initializers]
are probably consequences of copy&paste, thus unintended. This patch fixes them. 2023-09-04 Bruno Haible <br...@clisp.org> ieee754-h tests: Fix some gcc -Wmissing-field-initializers warnings. * tests/test-ieee754-h.c (float_tests): Use float literals. (double_tests): Use double literals. Initialize frac_lo. diff --git a/tests/test-ieee754-h.c b/tests/test-ieee754-h.c index 02e2db0531..559fa06715 100644 --- a/tests/test-ieee754-h.c +++ b/tests/test-ieee754-h.c @@ -26,9 +26,9 @@ static struct { unsigned sign; unsigned exponent; unsigned frac; } const float_tests[] = { - {0, 0, 0, 0}, - {-0.0, 1, 0, 0}, - {0.1, 0, 0x7b, 0x4ccccd} + {0.0f, 0, 0, 0}, + {-0.0f, 1, 0, 0}, + {0.1f, 0, 0x7b, 0x4ccccd} }; static struct { @@ -36,8 +36,8 @@ static struct { unsigned sign; unsigned exponent; unsigned frac_hi; unsigned frac_lo; } const double_tests[] = { - {0, 0, 0, 0}, - {-0.0, 1, 0, 0 }, + {0.0, 0, 0, 0, 0}, + {-0.0, 1, 0, 0, 0}, {0.1, 0, 0x3fb, 0x99999, 0x9999999a} };