qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 02ffa0: util/oslib-posix.c: Avoid warning on


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 02ffa0: util/oslib-posix.c: Avoid warning on NetBSD
Date: Fri, 21 Jul 2017 03:19:27 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 02ffa034fb747f09a4f5658ed64871dcee4aaca2
      
https://github.com/qemu/qemu/commit/02ffa034fb747f09a4f5658ed64871dcee4aaca2
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-21 (Fri, 21 Jul 2017)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix.c: Avoid warning on NetBSD

On NetBSD the compiler warns:
util/oslib-posix.c: In function 'sigaction_invoke':
util/oslib-posix.c:589:5: warning: missing braces around initializer 
[-Wmissing-braces]
     siginfo_t si = { 0 };
     ^
util/oslib-posix.c:589:5: warning: (near initialization for 'si.si_pad') 
[-Wmissing-braces]

because on this platform siginfo_t is defined as
  typedef union siginfo {
    char    si_pad[128];    /* Total size; for future expansion */
    struct _ksiginfo _info;
  } siginfo_t;

Avoid this warning by initializing the struct with {} instead;
this is a GCC extension but we use it all over the codebase already.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden


  Commit: 95a5befc2f8b359e72926f89cd661d063c2cf06c
      
https://github.com/qemu/qemu/commit/95a5befc2f8b359e72926f89cd661d063c2cf06c
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-21 (Fri, 21 Jul 2017)

  Changed paths:
    M gdbstub.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/scsi/scsi-generic.c
    M target/ppc/monitor.c

  Log Message:
  -----------
  Use qemu_tolower() and qemu_toupper(), not tolower() and toupper()

On NetBSD, where tolower() and toupper() are implemented using an
array lookup, the compiler warns if you pass a plain 'char'
to these functions:

gdbstub.c:914:13: warning: array subscript has type 'char'

This reflects the fact that toupper() and tolower() give
undefined behaviour if they are passed a value that isn't
a valid 'unsigned char' or EOF.

We have qemu_tolower() and qemu_toupper() to avoid this problem;
use them.

(The use in scsi-generic.c does not trigger the warning because
it passes a uint8_t; we switch it anyway, for consistency.)

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Acked-by: Christian Borntraeger <address@hidden> for the s390 part.
Acked-by: David Gibson <address@hidden>
Message-id: address@hidden


  Commit: 06943a626964c3dabb3931cacc7180cd22fa7fda
      
https://github.com/qemu/qemu/commit/06943a626964c3dabb3931cacc7180cd22fa7fda
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-21 (Fri, 21 Jul 2017)

  Changed paths:
    M bsd-user/mmap.c

  Log Message:
  -----------
  bsd-user/mmap.c: Move __thread attribute to right place

Avoid a compiler warning on OpenBSD:
bsd-user/mmap.c:28:1: warning: '__thread' is not at beginning of declaration 
[-Wold-style-declaration]
by moving the __thread attribute to its proper place.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden


  Commit: 710259565bd4bd2beba6731d430ab3b701c0f96a
      
https://github.com/qemu/qemu/commit/710259565bd4bd2beba6731d430ab3b701c0f96a
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-21 (Fri, 21 Jul 2017)

  Changed paths:
    M bsd-user/elfload.c

  Log Message:
  -----------
  bsd-user/elfload.c: Fix set-but-not-used warnings

Fix various warnings about set-but-not-used variables on OpenBSD:

bsd-user/elfload.c:1158:15: warning: variable 'mapped_addr' set but not used 
[-Wunused-but-set-variable]
bsd-user/elfload.c:1165:9: warning: variable 'status' set but not used 
[-Wunused-but-set-variable]
bsd-user/elfload.c:1168:15: warning: variable 'elf_stack' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden


Compare: https://github.com/qemu/qemu/compare/4439e1f1563a...710259565bd4

reply via email to

[Prev in Thread] Current Thread [Next in Thread]