diff mbox series

[1/2] linux-user/syscall: Silent -Wmissing-field-initializers warnings

Message ID 20221220144219.25254-2-philmd@linaro.org
State New
Headers show
Series linux-user: Fix a pair of -Wextra warnings | expand

Commit Message

Philippe Mathieu-Daudé Dec. 20, 2022, 2:42 p.m. UTC
Silent when compiling with -Wextra:

  In file included from ../../linux-user/syscall.c:5742:
  ../linux-user/ioctls.h:694:3: warning: missing field 'access' initializer [-Wmissing-field-initializers]
  IOCTL_IGNORE(TIOCSTART)
  ^
  ../linux-user/syscall.c:5741:31: note: expanded from macro 'IOCTL_IGNORE'
    { TARGET_ ## cmd, 0, #cmd },
                              ^
  ../linux-user/syscall.c:5743:13: warning: missing field 'name' initializer [-Wmissing-field-initializers]
    { 0, 0, },
            ^
  ../linux-user/syscall.c:12949:44: warning: missing field 'sigev_signo' initializer [-Wmissing-field-initializers]
        struct sigevent host_sevp = { {0}, }, *phost_sevp = NULL;
                                           ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 linux-user/syscall.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1f8c10f8ef..f3ab6bf5a6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5738,9 +5738,9 @@  IOCTLEntry ioctl_entries[] = {
 #define IOCTL_SPECIAL(cmd, access, dofn, ...)                      \
     { TARGET_ ## cmd, cmd, #cmd, access, dofn, {  __VA_ARGS__ } },
 #define IOCTL_IGNORE(cmd) \
-    { TARGET_ ## cmd, 0, #cmd },
+    { TARGET_ ## cmd, 0, #cmd, 0, NULL, { } },
 #include "ioctls.h"
-    { 0, 0, },
+    { /* end of list */ }
 };
 
 /* ??? Implement proper locking for ioctls.  */
@@ -12946,7 +12946,7 @@  static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
     {
         /* args: clockid_t clockid, struct sigevent *sevp, timer_t *timerid */
 
-        struct sigevent host_sevp = { {0}, }, *phost_sevp = NULL;
+        struct sigevent host_sevp = { }, *phost_sevp = NULL;
 
         int clkid = arg1;
         int timer_index = next_free_host_timer();
@@ -12993,7 +12993,7 @@  static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
             ret = -TARGET_EINVAL;
         } else {
             timer_t htimer = g_posix_timers[timerid];
-            struct itimerspec hspec_new = {{0},}, hspec_old = {{0},};
+            struct itimerspec hspec_new = { }, hspec_old = { };
 
             if (target_to_host_itimerspec(&hspec_new, arg3)) {
                 return -TARGET_EFAULT;
@@ -13019,7 +13019,7 @@  static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
             ret = -TARGET_EINVAL;
         } else {
             timer_t htimer = g_posix_timers[timerid];
-            struct itimerspec hspec_new = {{0},}, hspec_old = {{0},};
+            struct itimerspec hspec_new = { }, hspec_old = { };
 
             if (target_to_host_itimerspec64(&hspec_new, arg3)) {
                 return -TARGET_EFAULT;