diff options
| author | H.J. Lu <hjl.tools@gmail.com> | 2024-12-13 05:38:57 +0800 |
|---|---|---|
| committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-14 19:26:45 +0800 |
| commit | 8aa2a9e0339215012354f3c4a262edda838134e8 (patch) | |
| tree | 0c9e59246bcaf26bfb76478ca92cc12e9b43f8a0 /time | |
| parent | 1d40170dd367831b97cbdb89ad1b7241a241923b (diff) | |
| download | glibc-8aa2a9e0339215012354f3c4a262edda838134e8.tar.xz glibc-8aa2a9e0339215012354f3c4a262edda838134e8.zip | |
Add braces in initializers for GCC 4.9 or older
Add braces to silence GCC 4.9 or older:
getaddrinfo.c: In function ‘gaih_inet’:
getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces]
/ sizeof (struct gaih_typeproto)] = {0};
^
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'time')
| -rw-r--r-- | time/tst-itimer.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/time/tst-itimer.c b/time/tst-itimer.c index e7186e6200..3937deecc8 100644 --- a/time/tst-itimer.c +++ b/time/tst-itimer.c @@ -62,7 +62,8 @@ do_test (void) it.it_interval.tv_usec = 20; TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); - TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old), + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { { 0 } }, + &it_old), 0); /* ITIMER_REAL returns { 0, 0 } for single-shot timers, while other timers returns setitimer value. */ @@ -87,7 +88,8 @@ do_test (void) it.it_value.tv_usec = 40; TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); - TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old), + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { { 0 } }, + &it_old), 0); TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec); if (timers[i] == ITIMER_REAL) @@ -107,7 +109,7 @@ do_test (void) if (support_itimer_support_time64()) { TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); - TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { { 0 } }, &it_old), 0); /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while other @@ -134,7 +136,7 @@ do_test (void) { TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); - TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { { 0 } }, &it_old), 0); if (timers[i] == ITIMER_REAL) @@ -169,7 +171,8 @@ do_test (void) TEST_COMPARE (setitimer (ITIMER_REAL, &it, NULL), 0); intr_sleep (1); TEST_COMPARE (cnt, 3); - TEST_COMPARE (setitimer (ITIMER_REAL, &(struct itimerval) { 0 }, NULL), 0); + TEST_COMPARE (setitimer (ITIMER_REAL, &(struct itimerval) { { 0 } }, + NULL), 0); return 0; } |
