qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Laurent Vivier" <laurent@vivier.eu>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 1/2] linux-user/syscall: Silent -Wmissing-field-initializers warnings
Date: Tue, 20 Dec 2022 15:42:18 +0100	[thread overview]
Message-ID: <20221220144219.25254-2-philmd@linaro.org> (raw)
In-Reply-To: <20221220144219.25254-1-philmd@linaro.org>

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



  reply	other threads:[~2022-12-20 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 14:42 [PATCH 0/2] linux-user: Fix a pair of -Wextra warnings Philippe Mathieu-Daudé
2022-12-20 14:42 ` Philippe Mathieu-Daudé [this message]
2022-12-20 14:42 ` [PATCH 2/2] linux-user/signal: Silent -Winitializer-overrides warnings Philippe Mathieu-Daudé
2022-12-20 15:47   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221220144219.25254-2-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).